From: monishdeb Date: Mon, 3 Aug 2015 09:13:07 +0000 (+0530) Subject: improvement X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f013e5daba22226f5448d3927590ac6643d6fc9a;p=civicrm-core.git improvement --- diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 003730fb13..db4baa5166 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -351,7 +351,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { civicrm_subscription_history.method as method'; } - $where = " WHERE contact_a.id = %1 AND civicrm_group.is_active = 1 AND civicrm_group.saved_search_id IS NULL"; + $where = " WHERE contact_a.id = %1 AND civicrm_group.is_active = 1"; if ($excludeHidden) { $where .= " AND civicrm_group.is_hidden = 0 "; @@ -383,7 +383,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { //CRM-16945: seems hackish but as per CRM-16483 of using group criteria for Search Builder it is mandatory //to include group_contact_cache clause when group table is present, so following code remove duplicacy - $from = str_replace("OR civicrm_group.id = civicrm_group_contact_cache.group_id", '', $from); + $from = str_replace("OR civicrm_group.id = civicrm_group_contact_cache.group_id", 'AND civicrm_group.saved_search_id IS NULL', $from); $where .= " AND $permission ";