CRM-19080 - fix enotice in advance search
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 14 Jul 2016 05:55:03 +0000 (11:25 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 14 Jul 2016 05:55:03 +0000 (11:25 +0530)
CRM/Contact/Form/Search/Advanced.php

index 9eff8f8b99df53463072c5a16fd296a3c37b2a95..8d9f4b439212f50bfe3ddd1c8aa5469afe1bad62 100644 (file)
@@ -394,15 +394,17 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
      */
     if (isset($defaults['contact_tags'])) {
       foreach ($defaults['contact_tags'] as $key => $tagId) {
-        $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
-          unset($defaults['contact_tags'][$key]);
-          if (!isset($defaults[$element])) {
-            $defaults[$element] = array();
+        if (!is_array($tagId)) {
+          $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
+            unset($defaults['contact_tags'][$key]);
+            if (!isset($defaults[$element])) {
+              $defaults[$element] = array();
+            }
+            $defaults[$element][] = $tagId;
           }
-          $defaults[$element][] = $tagId;
         }
       }
       if (empty($defaults['contact_tags'])) {