CRM-19661, fixed query to add group by
authorPradeep Nayak <pradpnayak@gmail.com>
Thu, 17 Nov 2016 09:21:43 +0000 (14:51 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Fri, 18 Nov 2016 12:11:55 +0000 (17:41 +0530)
----------------------------------------
* CRM-19661: Notice error on Event Income Report (Detail)
  https://issues.civicrm.org/jira/browse/CRM-19661

CRM/Report/Form/Event/Income.php

index 6dabed59aca00b3207d187ae419a9a40d629459b..cf2745d9890b93182ed41a75c479f4a25f28119d 100644 (file)
@@ -108,7 +108,6 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event {
       "civicrm_option_value.label as event_type",
       "civicrm_participant.fee_currency as currency",
     );
-    $groupBy = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($select);
 
     $sql = "
             SELECT  " . implode(', ', $select) . ",
@@ -122,7 +121,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event {
             LEFT JOIN  civicrm_participant ON ( civicrm_event.id = civicrm_participant.event_id
                        {$activeParticipantClause} AND civicrm_participant.is_test  = 0 )
 
-            WHERE      civicrm_event.id IN( {$eventID}) {$groupBy}";
+            WHERE      civicrm_event.id IN( {$eventID}) GROUP BY civicrm_event.id";
 
     $eventDAO = CRM_Core_DAO::executeQuery($sql);
     $currency = array();