From 8f4db603c1be51e5911f32e97ab1d6c9567ac9ed Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Wed, 25 Jan 2017 15:58:00 +0530 Subject: [PATCH] CRM-19929: added missing pre hooks for entity tags --- CRM/Core/BAO/EntityTag.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Core/BAO/EntityTag.php b/CRM/Core/BAO/EntityTag.php index 6b4a74e913..a935a20e63 100644 --- a/CRM/Core/BAO/EntityTag.php +++ b/CRM/Core/BAO/EntityTag.php @@ -81,6 +81,9 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { // dont save the object if it already exists, CRM-1276 if (!$entityTag->find(TRUE)) { + //invoke pre hook + CRM_Utils_Hook::pre('create', 'EntityTag', $params['tag_id'], $params); + $entityTag->save(); //invoke post hook on entityTag @@ -142,6 +145,10 @@ class CRM_Core_BAO_EntityTag extends CRM_Core_DAO_EntityTag { $numEntitiesNotAdded = 0; $entityIdsAdded = array(); + //invoke pre hook for entityTag + $preObject = array($entityIds, $entityTable); + CRM_Utils_Hook::pre('create', 'EntityTag', $tagId, $preObject); + foreach ($entityIds as $entityId) { // CRM-17350 - check if we have permission to edit the contact // that this tag belongs to. -- 2.25.1