CRM-18035: Deleting file / attachment causes Undefined index: tag_id in CRM_Core_BAO_...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 25 Apr 2016 11:30:36 +0000 (17:00 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 25 Apr 2016 11:30:36 +0000 (17:00 +0530)
CRM/Core/BAO/EntityTag.php

index 4ecdded2141da604fad9083d2db475fd38aed8a6..10182decce834322f7d99e17662b3f81e5d732bf 100644 (file)
@@ -116,8 +116,10 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag {
     $entityTag->delete();
 
     //invoke post hook on entityTag
-    $object = array(0 => array(0 => $params['entity_id']), 1 => $params['entity_table']);
-    CRM_Utils_Hook::post('delete', 'EntityTag', $params['tag_id'], $object);
+    if (!empty($params['tag_id'])) {
+      $object = array(0 => array(0 => $params['entity_id']), 1 => $params['entity_table']);
+      CRM_Utils_Hook::post('delete', 'EntityTag', $params['tag_id'], $object);
+    }
   }
 
   /**