From 1d8fcdc5c7af5bea7c82bba130bc6f86a9811027 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 5 Feb 2019 12:59:51 +1300 Subject: [PATCH] dev/core#679 fix loss of search results when including tags or groups. The bug as described was a bit tricksy to replicate as it is inconsistent and the code is not actually outputting the tags/ groups. I think these are pre-existing issues I was able to replicate by having 2 search profiles - one with only tags & one one with only groups & switching back & and force on output - once I replicated I found that there was a regression due to https://github.com/eileenmcnaughton/civicrm-core/commit/2ca46d4d5a8cd15929ac0939ca2bb380a3de027e#diff-e54381bfdf51e31cab376c71ca0d66ffR4967 whereby the groupBy had been dropped, causing the results to be squashed into a single row --- 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 7952393fb8..4f8a2ac69a 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -4984,7 +4984,7 @@ civicrm_relationship.start_date > {$today} $select .= sprintf(", (%s) AS _wgt", $this->createSqlCase('contact_a.id', $cids)); $where .= sprintf(' AND contact_a.id IN (%s)', implode(',', $cids)); $order = 'ORDER BY _wgt'; - $groupBy = ''; + $groupBy = $this->_useGroupBy ? ' GROUP BY contact_a.id' : ''; $limit = ''; $query = "$select $from $where $groupBy $order $limit"; -- 2.25.1