Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.8, 4.0.8
-
Fix Version/s: 4.1.0
-
Component/s: CiviReport
-
Labels:None
Description
The current groupBy() method sets $_groupBy as an array of group-by definitions, but the buildQuery() method is expecting a fully built group by clause starting with "GROUP BY". This results in queries like "SELECT * FROM civicrm_foo WHERE (1) Array" (instead of "SELECT * FROM civicrm_foo foo WHERE (1) GROUP BY foo.id") so of course we get an SQL syntax error.
The current code appears to have been added for CRM-8503, before which this method was just a placeholder that needed to be overridden by the extending report class – I'm guessing this is why the bug has not been spotted until now.