From 75c9b4704b291c2feca7b8ce96d477c10e42ad17 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 11 Nov 2014 14:14:10 -0500 Subject: [PATCH] CRM-15585 - Call pre hooks from api.setvalue --- api/v3/Generic/Setvalue.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index bb1055259d..cae77e1193 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -69,8 +69,10 @@ function civicrm_api3_generic_setValue($apiRequest) { } $dao_name = _civicrm_api3_get_DAO($entity); - if (CRM_Core_DAO::setFieldValue($dao_name, $id, $field, $value)) { - $params = array('id' => $id, $field => $value); + $params = array('id' => $id, $field => $value); + CRM_Utils_Hook::pre('edit', $entity, $id, $params); + + if (CRM_Core_DAO::setFieldValue($dao_name, $id, $field, $params[$field])) { $entityDAO = new $dao_name(); $entityDAO->copyValues($params); CRM_Utils_Hook::post('edit', $entity, $entityDAO->id, $entityDAO); -- 2.25.1