From 5fb2e4451e3b912cbf537226baa3b6c800bfe9f6 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 25 Apr 2016 17:00:36 +0530 Subject: [PATCH] CRM-18035: Deleting file / attachment causes Undefined index: tag_id in CRM_Core_BAO_EntityTag::del() --- CRM/Core/BAO/EntityTag.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/EntityTag.php b/CRM/Core/BAO/EntityTag.php index 4ecdded214..10182decce 100644 --- a/CRM/Core/BAO/EntityTag.php +++ b/CRM/Core/BAO/EntityTag.php @@ -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); + } } /** -- 2.25.1