From abe95f292f09f0bd9f5664fecae646707072f64f Mon Sep 17 00:00:00 2001 From: monishdeb Date: Sat, 12 Jul 2014 02:22:13 +0530 Subject: [PATCH] CRM-14969 fix - Array to string conversion in CRM_Utils_Hook::post() https://issues.civicrm.org/jira/browse/CRM-14969 --- api/v3/Generic/Setvalue.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index be0553354b..7fd4e40355 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -63,13 +63,15 @@ function civicrm_api3_generic_setValue($apiRequest) { return civicrm_api3_create_error("Param '$field' is of a type not managed yet (".$def['type']."). Join the API team and help us implement it", array('error_code' => 'NOT_IMPLEMENTED')); } - if (CRM_Core_DAO::setFieldValue(_civicrm_api3_get_DAO($entity), $id, $field, $value)) { - $entity = array('id' => $id, $field => $value); - CRM_Utils_Hook::post('edit', $entity, $id, $entity); + $dao_name = _civicrm_api3_get_DAO($entity); + if (CRM_Core_DAO::setFieldValue($dao_name, $id, $field, $value)) { + $params = array('id' => $id, $field => $value); + $entityDAO = new $dao_name(); + $entityDAO->copyValues($params); + CRM_Utils_Hook::post('edit', $entity, $id, $entityDAO); return civicrm_api3_create_success($entity); } else { return civicrm_api3_create_error("error assigning $field=$value for $entity (id=$id)"); } } - -- 2.25.1