Reports Dashlet configuration bug for date “Period” parameters when using more than one report parameter, causing a fatal error and empty dashlet. #10610
Labels
Type: Bug
Bugs within the core SuiteCRM codebase
Issue
Description of the Issue
When an Advanced Open Reports (AOR) dashlet has multiple parameters and one of them is a “Period” parameter that is not the first parameter in the report, the dashlet config template renders that parameter using:
instead of
Meanwhile, the associated hidden fields for that parameter use [{$condition.key}]. As a result, SuiteCRM’s backend receives inconsistent array indexes for this parameter in requestToUserParameters(), passing an empty or invalid value to getPeriodEndDate(). Eventually, this can trigger a fatal error (“Call to a member function sub() on null”).
Possible Fix
In the dashlet configuration template, change the select for Period to include the condition.key index.
For Instance, in:
replace with
Steps to Reproduce the Issue
2. Add this report as a dashlet on the Home page.
3. In the dashlet configuration screen, check that the “Period” parameter is displayed. Observe that the generated HTML select uses name="parameter_value[]" instead of something like name="parameter_value[0]".
4. After saving or changing the parameter in the dashlet, SuiteCRM’s changeReportPage action may throw a fatal error or fail to load the correct data.
If the “Period” parameter is the first parameter in the report, you may not see the issue because the code and indexes sometimes align. The bug appears when the Period parameter is not the first in the list, causing mismatched indexes in the dashlet config form.
Context
Context
• This bug affects any user trying to configure an AOR Report Dashlet that includes “Period” type parameters.
• It can result in an empty or incorrect value for the parameter, sometimes causing a PHP fatal error if SuiteCRM attempts to manipulate a null date object.
Version
7.14.6
What browser are you currently using?
Chrome
Browser Version
Chrome
Environment Information
Mysql, PHP
Operating System and Version
Ubuntu
The text was updated successfully, but these errors were encountered: