Skip to content
Snippets Groups Projects
Commit d085c5eb authored by eileen's avatar eileen
Browse files

fixes for regression on contribution.update

parent e2747b59
Branches
Tags
No related merge requests found
......@@ -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']) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment