From 2663d5df523bb47eb63fed7107dc997dcef3023a Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 5 Feb 2019 14:58:53 +1300 Subject: [PATCH] Disable full group by mode whe groupContacts is TRUE This prevents an error when using the cache and allows us to move past this without untangling the messy way other tables are joined back in for now. Note it became necessary due to query changes off the cache but the query is no different in accuracy --- CRM/Contact/BAO/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 4f8a2ac69a..92c47c34bf 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4904,7 +4904,7 @@ civicrm_relationship.start_date > {$today} // MySQL expect the columns present in GROUP BY, must be present in SELECT clause and that results into error, needless to have other columns. // 2. When GROUP BY columns are present then disable FGB otherwise it demands to add ORDER BY columns in GROUP BY and eventually in SELECT // clause. This will impact the search query output. - $disableFullGroupByMode = ($sortByChar || !empty($groupByCols)); + $disableFullGroupByMode = ($sortByChar || !empty($groupByCols) || $groupContacts); if ($disableFullGroupByMode) { CRM_Core_DAO::disableFullGroupByMode(); -- 2.25.1