CRM-15585 - Call pre hooks from api.setvalue
authorColeman Watts <coleman@civicrm.org>
Tue, 11 Nov 2014 19:14:10 +0000 (14:14 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 11 Nov 2014 19:14:10 +0000 (14:14 -0500)
api/v3/Generic/Setvalue.php

index bb1055259dbbb8a6191830ce522589d2c3a9b464..cae77e1193f1873081198701da9a5be62a0677dc 100644 (file)
@@ -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);