Customisation for reports AOR_Reports

Hi team,

Want to ask about customisation for AOR_Reports\aor_utils.php. I have added some specific date ranges as new Periods in date_time_period_list and put corresponding if and case blocks in getPeriodDate and getPeriodEndDate functions in aor_utils.php.

I have performed all these changes in custom\modules\AOR_Reports\aor_utils.php. I have adjusted permissions for the new custom file and folders, and QRed but when I select the new Period for my condition of report, report did not run.

I have copied all the new content to original aor_utils.php and then report runs with the new period.

Do you have any idea why ? does the AOR_Report module does not look at custom folders ? How to save changes for the SuiteCRM updates ? (Mine is 7.11.13 though)

Thanks in advance.

Hi,

CRM will not look directly into “aor_utils.php” in custom folder.
You need to reference this custom aor_utils.php file everywhere into AOR_Reports module.

Like in the file

modules/AOR_Reports/AOR_Report.php and change the line number 75.
and also in
modules/AOR_Reports/controller.php and change the line number 28.

Thanks

Thanks

but it will again NOT upgrade/update safe then right ?

The suggestion by @suitecrm_developer will not be upgrade safe, there is a potential for a bug to be causing the issues, so you have any errors or mentions of the file within the logs?

Thanks,

I have reverted back the modules/AOR_Reports/aor_utils.php and make the change on custom/modules/AOR_Reports/aor_utils.php and then tried to run the report with new date period last 14 days. This is defined in aor_utils.php in custom folder.

Here what I see on my screen and php-fpm\www-error.log, nothing in suitecrm.log

[root@scrm php-fpm]# tail -f www-error.log
[26-May-2020 21:48:46 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function format() on null in /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php:1916
Stack trace:
#0 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(1171): AOR_Report->build_report_query_where(Array)
#1 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(639): AOR_Report->build_report_query(’’, Array)
#2 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(626): AOR_Report->build_report_html(0, true, ‘’, ‘7b56a027-f4ec-b…’, Array)
#3 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(363): AOR_Report->build_group_report(0, true, Array)
#4 /var/www/html/suitecrm/modules/AOR_Reports/views/view.detail.php(78): AOR_Report->buildMultiGroupReport(0, true)
#5 /var/www/html/suitecrm/include/MVC/View/SugarView.php(224): AOR_ReportsViewDetail->preDisplay()
#6 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(435): SugarView->process()
#7 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(375): SugarController->processVi in /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php on line 1916

The changes i suggested are not upgrafe safe…
I think we can never do it upgrade safe…as we need to change the core code of reports module.
For the error that is appearing, i think you should any experienced degeloper to do it for you.

Thanks

If you look at previous post, I have shared error messages upon request from @Mac-Rae , and error does not happen when I perform the changes to aor_utils.php in modules folder.

Ok @obekatli,

After speaking to some of our internal devs, it does look like aor_utils.php for some reason is not able to be dynamically called and therefore is not extendable.

Like what @suitecrm_developer said, all files would have to be directed to this new custom file which may involve changes to core files. I would suggest trying to make custom files for the two that were suggested to edit and if possible make the edits within those custom files to call the custom file specifically.

Let me know if you have any luck!

Nope,

I have copied AOR_Report.php and controller.php to /custom/modules/AOR_Reports.

Changed the lines 75 and 25 in both files to point aor_utils.php in the same custom folder.

and the error log:

[27-May-2020 21:32:29 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function format() on null in /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php:1916
Stack trace:
#0 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(1171): AOR_Report->build_report_query_where(Array)
#1 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(639): AOR_Report->build_report_query(’’, Array)
#2 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(626): AOR_Report->build_report_html(0, true, ‘’, ‘4af00c86-4381-9…’, Array)
#3 /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php(363): AOR_Report->build_group_report(0, true, Array)
#4 /var/www/html/suitecrm/modules/AOR_Reports/views/view.detail.php(78): AOR_Report->buildMultiGroupReport(0, true)
#5 /var/www/html/suitecrm/include/MVC/View/SugarView.php(224): AOR_ReportsViewDetail->preDisplay()
#6 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(435): SugarView->process()
#7 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(375): SugarController->processVi in /var/www/html/suitecrm/modules/AOR_Reports/AOR_Report.php on line 1916
[27-May-2020 21:35:23 Europe/Berlin] PHP Fatal error: Cannot redeclare convertToDateTime() (previously declared in /var/www/html/suitecrm/custom/modules/AOR_Reports/aor_utils.php:481) in /var/www/html/suitecrm/modules/AOR_Reports/aor_utils.php on line 475