Report Dashlet Not Loading Report running SuiteCRM version 7.12.6

Trying to load a report into the Report Dashlet and nothing loads. Found the error below.

Any help would be appricated.

[Mon Sep 19 20:31:39.610428 2022] [proxy_fcgi:error] [pid 99270:tid 140059175831296] [client 10.40.10.129:50132] AH01071: Got error 'PHP message: PHP Warning: Undefined array key “parameter_value” in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php on line 142

PHP message: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php:142
Stack trace:
#0 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(893): AORReportsDashlet->saveOptions()
#1 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(522): SugarController->action_configuredashlet()
#2 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(491): SugarController->do_action()
#3 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(465): SugarController->handle_action()
#4 /bitnami/suitecrm/include/MVC/Controller/SugarController.php(361): SugarController->process()
#5 /bitnami/suitecrm/include/MVC/SugarApplication.php(101): SugarController->execute()
#6 /bitnami/suitecrm/index.php(52): SugarApplication->execute()
#7 {main}\n thrown in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php on line 142’, referer: http://10.10.39.1/index.php?module=Home&action=index

[Mon Sep 19 20:31:39.865035 2022] [proxy_fcgi:error] [pid 659:tid 140058816280320] [client 10.40.10.129:50133] AH01071: Got error ‘PHP message: PHP Warning: Attempt to read property “id” on null in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php on line 57’, referer: http://10.10.39.1/index.php?module=Home&action=index

[Mon Sep 19 20:31:44.318835 2022] [proxy_fcgi:error] [pid 99270:tid 140058648426240] [client 10.40.10.129:50134] AH01071: Got error ‘PHP message: PHP Warning: Attempt to read property “id” on null in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php on line 93PHP message: PHP Warning: Attempt to read property “name” on null in /bitnami/suitecrm/modules/AOR_Reports/Dashlets/AORReportsDashlet/AORReportsDashlet.php on line 94PHP message: PHP Warning: Undefined array key “LBL_DASHLET_SELECT_REPORT” in /bitnami/suitecrm/cache/smarty/templates_c/%%D7^D74^D74EEC47%%dashletConfigure.tpl.php on line 38PHP message: PHP Warning: Undefined array key “LBL_DASHLET_SELECT_REPORT” in /bitnami/suitecrm/cache/smarty/templates_c/%%D7^D74^D74EEC47%%dashletConfigure.tpl.php on line 39PHP message: PHP Warning: Undefined array key “LBL_DASHLET_CLEAR_REPORT” in /bitnami/suitecrm/cache/smarty/templates_c/%%D7^D74^D74EEC47%%dashletConfigure.tpl.php on line 57PHP message: PHP Warning: Undefined array key “LBL_DASHLET_CLEAR_REPORT” in /bitnami/suitecrm/cache/smarty/templates_c/%%D7^D74^D74EEC47%%dashletConfigure.tpl.php on line 59’, referer: http://10.10.39.1/index.php?module=Home&action=index

Check that your PHP version is within the Matrix:

Thanks for the suggestion but we are on version 8 of PHP which the matrix says is correct for SuiteCRM 7.12

Can you try this fix?

We made this change and the problem remains. Cannot load the report into the Dashlet. Thanks again for your suggestion.

Hhhm I don’t know, then.

Just a few random things to try:

  • delete the cached file /bitnami/suitecrm/cache/smarty/templates_c/%%D7^D74^D74EEC47%%dashletConfigure.tpl.php , it will get re-created and might come up different

  • in Admin / Repairs, run a repair dashlets action.

  • try commenting out continue as explained here.

Same here. PHP 8.0, Suitecrm 7.13.1

Homepage crashes if there are already Report Dashlets created.
If we reset the homepage it is impossible to add Report Dashlet.

Can’t go back to PHP 7.4, apache crashes for some unknown reasons.
It will be faster to solve this issue in the code.

Thanks

In the file \modules\AOR_Reports\Dashlets\AORReportsDashlet\AORReportsDashlet.php

from line 142 replace

         for ($i = 0; $i < count($req['parameter_value']); $i++) {
                if (isset($req['parameter_value'][$i]) && $req['parameter_value'][$i] != '') {
                    global $current_user, $timedate;
                    $user_date_format = $timedate->get_date_format($current_user);

                    if (DateTime::createFromFormat($user_date_format, $req['parameter_value'][$i]) !== false) {
                        $date = DateTime::createFromFormat($user_date_format, $req['parameter_value'][$i]);
                        $date->setTime(00, 00, 00);
                        $req['parameter_value'][$i] = $timedate->asDb($date);
                    }
                }
            }

with

if(!empty($req['parameter_value'])) {
            for ($i = 0; $i < count($req['parameter_value']); $i++) {
                if (isset($req['parameter_value'][$i]) && $req['parameter_value'][$i] != '') {
                    global $current_user, $timedate;
                    $user_date_format = $timedate->get_date_format($current_user);

                    if (DateTime::createFromFormat($user_date_format, $req['parameter_value'][$i]) !== false) {
                        $date = DateTime::createFromFormat($user_date_format, $req['parameter_value'][$i]);
                        $date->setTime(00, 00, 00);
                        $req['parameter_value'][$i] = $timedate->asDb($date);
                    }
                }
            }
        }
4 Likes

Thanks !! It is making progress.

Now we can add new Dashlets, but as soon as we save filters it crashes again with this now:

Fatal error: Uncaught Error: Non-static method SugarWidgetReportField::_get_column_select() cannot be called statically in /Data/websites/crm.asiaction.com/include/generic/SugarWidgets/SugarWidgetFieldname.php:229 Stack trace: #0 /Data/websites/crm.asiaction.com/include/Dashlets/DashletGeneric.php(365): SugarWidgetFieldName->queryFilterone_of() #1 /Data/websites/crm.asiaction.com/include/Dashlets/DashletGeneric.php(415): DashletGeneric->buildWhere() #2 /Data/websites/crm.asiaction.com/modules/Home/index.php(244): DashletGeneric->process() #3 /Data/websites/crm.asiaction.com/modules/Home/views/view.list.php(54): include('...') #4 /Data/websites/crm.asiaction.com/include/MVC/View/SugarView.php(210): HomeViewList->display() #5 /Data/websites/crm.asiaction.com/include/MVC/Controller/SugarController.php(432): SugarView->process() #6 /Data/websites/crm.asiaction.com/include/MVC/Controller/SugarController.php(363): SugarController->processView() #7 /Data/websites/crm.asiaction.com/include/MVC/SugarApplication.php(101): SugarController->execute() #8 /Data/websites/crm.asiaction.com/index.php(52): SugarApplication->execute() #9 {main} thrown in /Data/websites/crm.asiaction.com/include/generic/SugarWidgets/SugarWidgetFieldname.php on line 229

Can you help again ?

Thank you.

Go to this file
include/generic/SugarWidgets/SugarWidgetFieldname.php
search for
SugarWidgetFieldid::_get_column_select
and replace it with
$this->_get_column_select

2 Likes

Thanks. It is working.

1 Like

Can confirm this issue exists on 7.13.3
provided code fixes the issue

Is there an Issue and a a PR with this fix already on GitHub? If there is, someone please post a link here. I’d there isn’t, someone please open it :slight_smile:

Hello,

I found the issue #9104 that it’s related to this case.

1 Like

And this one actually has the same PHP error:

EDIT: although initially I had proposed the same solution that @abuzarfaris gave above, later I found out that there are more instances of the static call that need correction, and more importantly, that the correct fix is this:

Instead of using $this to call the method, a new object must be instantiated, because $this is not the correct class for the intended method, it’s another one.

2 Likes

worked for me. thanks for that.

Using v7.13

I am getting a console error when I am trying to save or edit any dashlet on home screen.

How did you resolve this issue?

MySugar.js?v=6WY0eIRvQx-xSuYs2iwxMg:49 Uncaught ReferenceError: newTop is not defined
    at Object.fillInConfigureDiv (MySugar.js?v=6WY0eIRvQx-xSuYs2iwxMg:49:481)
    at Object.handleTransactionResponse (sugar_grp1_yui.js?v=6WY0eIRvQx-xSuYs2iwxMg:31:4422)
    at sugar_grp1_yui.js?v=6WY0eIRvQx-xSuYs2iwxMg:31:3935