From: Donald A. Lobo Date: Thu, 21 Nov 2013 00:30:55 +0000 (-0800) Subject: CRM-13799 - group contacts list doesn't reflect correct status X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c905b59ff361ecaa0dfd7c6c17fafdf1ea278903;p=civicrm-core.git CRM-13799 - group contacts list doesn't reflect correct status http://issues.civicrm.org/jira/browse/CRM-13799 --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c5ef91bfe0..5d5a8174c3 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1526,6 +1526,7 @@ class CRM_Contact_BAO_Query { case 'group': $this->group($values); return; + case 'group_type': // so we resolve this into a list of groups & proceed as if they had been // handed in @@ -1537,8 +1538,8 @@ class CRM_Contact_BAO_Query { $this->_paramLookup['group'][0][2] = $values[2] = $this->getGroupsFromTypeCriteria($value); $this->group($values); return; - // case tag comes from find contacts + // case tag comes from find contacts case 'tag_search': $this->tagSearch($values); return; @@ -2637,7 +2638,7 @@ class CRM_Contact_BAO_Query { if (!$skipGroup) { $gcTable = "`civicrm_group_contact-{$groupIds}`"; - $this->_tables[$gcTable] = $this->_whereTables[$gcTable] = " LEFT JOIN civicrm_group_contact {$gcTable} ON contact_a.id = {$gcTable}.contact_id "; + $this->_tables[$gcTable] = $this->_whereTables[$gcTable] = " LEFT JOIN civicrm_group_contact {$gcTable} ON ( contact_a.id = {$gcTable}.contact_id AND {$gcTable}.group_id $op ( $groupIds ) )"; } $qill = ts('Contacts %1', array(1 => $op));