From: eileen Date: Mon, 18 Mar 2013 19:32:02 +0000 (+1300) Subject: fixes for regression on contribution.update X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d085c5eba3c29105414850eebdfb50db165081e0;p=civicrm-core.git fixes for regression on contribution.update --- diff --git a/api/v3/Generic/Update.php b/api/v3/Generic/Update.php index 9975de71e5..1950e966dd 100644 --- a/api/v3/Generic/Update.php +++ b/api/v3/Generic/Update.php @@ -25,6 +25,11 @@ function civicrm_api3_generic_update($apiRequest) { if (!array_key_exists($key_id, $apiRequest['params'])) { return $errorFnName("Mandatory parameter missing $key_id"); } + // tests show that contribution works better with create + // this is horrible but to make it work we'll just handle it separately + if(strtolower($apiRequest['entity']) == 'contribution'){ + return civicrm_api($apiRequest['entity'], 'create', $apiRequest['params']); + } $seek = array($key_id => $apiRequest['params'][$key_id], 'version' => $apiRequest['version']); $existing = civicrm_api($apiRequest['entity'], 'get', $seek); if ($existing['is_error']) {