From 1473b0ec1108071a6d1b3825d5f720b266d554d1 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Wed, 8 Mar 2017 16:29:26 -0500 Subject: [PATCH] CRM-20020 - ensure search works when both smart and regular groups are used. --- 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 2f53414335..42ddead91a 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -3002,7 +3002,7 @@ class CRM_Contact_BAO_Query { } $and = ($op == 'IS NULL') ? ' AND ' : ' OR '; - $this->_where[$grouping][] = implode($and, $groupClause); + $this->_where[$grouping][] = ' ( ' . implode($and, $groupClause) . ' ) '; list($qillop, $qillVal) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contact_DAO_Group', 'id', $value, $op); $this->_qill[$grouping][] = ts("Group(s) %1 %2", array(1 => $qillop, 2 => $qillVal)); -- 2.25.1