From: Kurund Jalmi Date: Fri, 19 Jul 2013 19:14:39 +0000 (+0530) Subject: fixes to handle group and tag display in selector for search builder, CRM-11790 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fd18baa6c6fb5813a429c8cc520e97833b0b4747;p=civicrm-core.git fixes to handle group and tag display in selector for search builder, CRM-11790 --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index c9d11fc4fb..63f2fb31be 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -607,10 +607,19 @@ class CRM_Contact_BAO_Query { continue; } + //special handling for groups/tags + $makeException = FALSE; + if (in_array($name, array('groups', 'tags')) + && isset($this->_returnProperties[substr($name, 0, -1)]) + ) { + $makeException = TRUE; + } + $cfID = CRM_Core_BAO_CustomField::getKeyID($name); if ( CRM_Utils_Array::value($name, $this->_paramLookup) || - CRM_Utils_Array::value($name, $this->_returnProperties) + CRM_Utils_Array::value($name, $this->_returnProperties) || + $makeException ) { if ($cfID) { // add to cfIDs array if not present diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 9986741f6e..14261fe63c 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -1073,6 +1073,9 @@ SELECT 'civicrm_contact', contact_a.id, contact_a.id, '$cacheKey', contact_a.dis $properties = array(); foreach ($returnProperties as $name => $value) { if ($name != 'location') { + if (in_array($name, array('group', 'tag'))) { + $name = "{$name}s"; + } $properties[] = $name; } else {