From 0848e4b11537872187e6286c7c42b0fe998d1ce5 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Fri, 18 Nov 2016 17:40:57 +0530 Subject: [PATCH] CRM-19661, fixed sql for Group by clause for mysql version 5.7+ ---------------------------------------- * CRM-19661: Notice error on Event Income Report (Detail) https://issues.civicrm.org/jira/browse/CRM-19661 --- CRM/Report/Form/Event/Income.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index cf2745d989..3762247042 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -109,6 +109,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { "civicrm_participant.fee_currency as currency", ); + $groupBy = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($select, 'civicrm_event.id'); $sql = " SELECT " . implode(', ', $select) . ", SUM(civicrm_participant.fee_amount) as total, @@ -121,7 +122,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}) GROUP BY civicrm_event.id"; + WHERE civicrm_event.id IN( {$eventID}) {$groupBy}"; $eventDAO = CRM_Core_DAO::executeQuery($sql); $currency = array(); -- 2.25.1