KReportPresentationManager - an error on function display()

I am using kreporter 3.1 with PHP 7.4
Why I am getting the below error and what is solution for it?

PHP Fatal error:  Uncaught Error: Call to a member function display() on bool in /var/www/html/CRM/modules/KReports/KReportPresentationManager.php:45
Stack trace:
#0 /var/www/html/suitecrm/modules/KReports/views/view.detail.php(94): KReportPresentationManager->renderPresentation()
#1 /var/www/html/CRM/include/MVC/View/SugarView.php(210): KReportsViewDetail->display()
#2 /var/www/html/CRM/include/MVC/Controller/SugarController.php(432): SugarView->process()
#3 /var/www/html/CRM/include/MVC/Controller/SugarController.php(363): SugarController->processView()
#4 /var/www/html/CRM/include/MVC/SugarApplication.php(101): SugarController->execute()
#5 /var/www/html/CRM/index.php(52): SugarApplication->execute()
#6 {main}
  thrown in /var/www/html/CRM/modules/KReports/KReportPresentationManager.php on line 45

Line 45 code is:

return $pluginObject->display($thisReport);

  • Function code is:
    public function renderPresentation($thisReport) {
        $listOptions = json_decode(html_entity_decode($thisReport->presentation_params), true);
        if(!empty($listOptions['plugin']))
            $pluginObject = $this->pluginManager->getPresentationObject($listOptions['plugin']);
        else
            $pluginObject = $this->pluginManager->getPresentationObject($thisReport->listtype);
        return $pluginObject->display($thisReport);
    }

@rsp I have strong doubts that keporter 3.1 can run under php 7.4.

Do you think? This error is related to PHP version.

@rsp The $pluginObject is false instead of being an object. Might come from a misinterpreation due to the php verison in getPresentationObject() or it is is server access rights problem for the plugin folder. Difficult to say. You will habe to debug.

I checked. It is not access rights problem. :upside_down_face:

Could we replace that function with the below code?

public function renderPresentation($thisReport) {
    $listOptions = json_decode(html_entity_decode($thisReport->presentation_params), true);
    if (!empty($listOptions['plugin'])) {
        $pluginObject = $this->pluginManager->getPresentationObject($listOptions['plugin']);
    } else {
        $pluginObject = $this->pluginManager->getPresentationObject($thisReport->listtype);
    }

    if (is_object($pluginObject) && method_exists($pluginObject, 'display')) {
        return $pluginObject->display($thisReport);
    } else {
        throw new Exception('Error: Unable to call display method on plugin object');
    }
}

@rsp you can do whatever you think is suitable. KReporter 3.1 is no longer supported