CRM-18656 - minor optimisation
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 20 Jun 2016 10:09:12 +0000 (15:39 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 20 Jun 2016 10:14:30 +0000 (15:44 +0530)
CRM/Contact/Form/Search/Advanced.php

index 768d52fa768186f96d7f44fe99b23cda4478d196..9eff8f8b99df53463072c5a16fd296a3c37b2a95 100644 (file)
@@ -393,12 +393,8 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
      * id of the tagset.
      */
     if (isset($defaults['contact_tags'])) {
-      $tag = new CRM_Core_BAO_Tag();
       foreach ($defaults['contact_tags'] as $key => $tagId) {
-        $params = array('id' => $tagId);
-        $result = array();
-        $tag->retrieve($params, $result);
-        $parentId = $result['parent_id'];
+        $parentId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Tag', $tagId, 'parent_id');
         $element = "contact_taglist[$parentId]";
         if ($this->elementExists($element)) {
           // This tag is a tagset