diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 7018b6e86204..828db1f7e3b9 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -39,6 +39,8 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { public static function create($params) { $id = CRM_Utils_Array::value('id', $params); + $op = empty($id) ? 'create' : 'edit'; + CRM_Utils_Hook::pre('UFField', $op, $id, $params); // Merge in data from existing field if (!empty($id)) { $UFField = new CRM_Core_BAO_UFField(); @@ -105,6 +107,8 @@ public static function create($params) { $fieldsType = CRM_Core_BAO_UFGroup::calculateGroupType($ufField->uf_group_id, TRUE); CRM_Core_BAO_UFGroup::updateGroupTypes($ufField->uf_group_id, $fieldsType); + CRM_Utils_Hook::post('UFField', $op, $ufField->id, $ufField); + civicrm_api3('profile', 'getfields', ['cache_clear' => TRUE]); return $ufField; }