Skip to content

Fatal Error upon downloading reports when "Select Related Modules" is empty

If you have a report where the field Select Related Modules (MAX 2) is empty:

image

Then there is a Fatal Error when you try to download the report in CSV or EXCEL format:

Fatal error: Uncaught Error: Call to a member function getId() on boolean in /var/www/html/vt/modules/Reports/views/ExportReport.php:105 Stack trace: #0 /var/www/html/vt/modules/Reports/views/ExportReport.php(48): Reports_ExportReport_View->checkReportModulePermission(Object(Vtiger_Request)) #1 /var/www/html/vt/includes/runtime/Controller.php(64): Reports_ExportReport_View->GetXLS(Object(Vtiger_Request)) #2 /var/www/html/vt/modules/Reports/views/ExportReport.php(37): Vtiger_Controller->invokeExposedMethod('GetXLS', Object(Vtiger_Request)) #3 /var/www/html/vt/includes/main/WebUI.php(215): Reports_ExportReport_View->process(Object(Vtiger_Request)) #4 /var/www/html/vt/index.php(20): Vtiger_WebUI->process(Object(Vtiger_Request)) #5 {main} thrown in /var/www/html/vt/modules/Reports/views/ExportReport.php on line 105

The code basically tries to instantiate a module with an empty string, because one of the elements of $modulesList is empty in /var/www/html/vt/modules/Reports/views/ExportReport.php:

image

Here is my debug output:

image