// 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
$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.