From e40366108d88ed27c9fbab990132ed9bafc759b3 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 14 Feb 2017 15:52:32 -0500 Subject: [PATCH] CRM-20020 - fix search with parent groups + other criteria Previously, search always returned all contacts in the specified group rather than contacts who also met the added criteria. --- 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 d7e47b6520..2f53414335 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -2993,7 +2993,7 @@ class CRM_Contact_BAO_Query { $gcTable = ($op == '!=') ? 'cgc' : $gcTable; $childClause = " OR {$gcTable}.group_id IN (" . implode(',', $childGroupIds) . ") "; } - $groupClause[] = sprintf($clause, $childClause); + $groupClause[] = '(' . sprintf($clause, $childClause) . ')'; } //CRM-19589: contact(s) removed from a Smart Group, resides in civicrm_group_contact table -- 2.25.1