From 0a6eb46f54370eb5ade56b74d9a106aaf83603ea Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Thu, 11 Apr 2019 18:00:34 +0100 Subject: [PATCH] Make hook_civicrm_pre() and hook_civicrm_post() fire on CaseContacts --- CRM/Case/BAO/CaseContact.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Case/BAO/CaseContact.php b/CRM/Case/BAO/CaseContact.php index a8cfcdbb02..9d8a395520 100644 --- a/CRM/Case/BAO/CaseContact.php +++ b/CRM/Case/BAO/CaseContact.php @@ -45,10 +45,15 @@ class CRM_Case_BAO_CaseContact extends CRM_Case_DAO_CaseContact { * @return CRM_Case_BAO_CaseContact */ public static function create($params) { + $hook = empty($params['id']) ? 'create' : 'edit'; + CRM_Utils_Hook::pre($hook, 'CaseContact', CRM_Utils_Array::value('id', $params), $params); + $caseContact = new self(); $caseContact->copyValues($params); $caseContact->save(); + CRM_Utils_Hook::post($hook, 'CaseContact', $caseContact->id, $caseContact); + // add to recently viewed $caseType = CRM_Case_BAO_Case::getCaseType($caseContact->case_id); $url = CRM_Utils_System::url('civicrm/contact/view/case', -- 2.25.1