Skip to content

Commit

Permalink
Disable full group by mode whe groupContacts is TRUE
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eileenmcnaughton committed Feb 5, 2019
1 parent 39fec01 commit 2663d5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4904,7 +4904,7 @@ public function searchQuery(
// 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();
Expand Down

0 comments on commit 2663d5d

Please sign in to comment.