From 00a031102194c80946f049320b2d1e686db08acf Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 25 May 2019 20:32:54 +1200 Subject: [PATCH] Disable full group by when selecting contacts --- CRM/Contact/BAO/Query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 46840be319..ddabd4f313 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4960,6 +4960,7 @@ civicrm_relationship.start_date > {$today} * @return CRM_Core_DAO */ public function getCachedContacts($cids, $includeContactIds) { + CRM_Core_DAO::disableFullGroupByMode(); CRM_Utils_Type::validateAll($cids, 'Positive'); $this->_includeContactIds = $includeContactIds; $onlyDeleted = in_array(['deleted_contacts', '=', '1', '0', '0'], $this->_params); @@ -4971,7 +4972,9 @@ civicrm_relationship.start_date > {$today} $limit = ''; $query = "$select $from $where $groupBy $order $limit"; - return CRM_Core_DAO::executeQuery($query); + $result = CRM_Core_DAO::executeQuery($query); + CRM_Core_DAO::reenableFullGroupByMode(); + return $result; } /** -- 2.25.1