Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
AOR Reports main grouping by custom fields results in FATAL error #4973
If you will create an AOR Report with a custom field and set the "Main Group" dropdown to this filed, then it will result in a FATAL error:
This report cannot edited anymore.
Main group selection by any custom field should work.
PHP error will be displayed in a modal popup:
Problem is a mix with strings and arrays on modules/AOR_Reports/AOR_Reports.php.
On function build_group_report (line: 416) the $query variable will be initialized as string:
In the same function on line 468 ff this variable will be passed to the function build_report_query_join which expect an array on parameter 6:
Possible fix (workaround) could be to pass an empty array if query is empty:
But take care of the line 459. If there is a currency field in place then $query variable is already an array. This will cause some similar issues later on, because the $query variable will concatenated as string.
Steps to Reproduce
From my point of view this bug has to fixed, because it looks like some similar issues will pop up regarding this mix of array and string operations.
Jan 18, 2018
On thing I noticed, not sure if related to this issue. If I group by text field or dropdown field it works fine, but if I group by an integer field value (ie: I have 25,50,75,100 in terms of a percent complete) it crashes out the server.
I think the issue in this case is the percentage symbol '%'
Does your field have the % in its name? If so it might be more sensible to set the name to something like completion_percentage and only put the % symbol in the label.
This is just a guess on my side though.