+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
if (strtolower($apiRequest['entity']) == 'contribution') {
return civicrm_api($apiRequest['entity'], 'create', $apiRequest['params']);
}
- $seek = array($key_id => $apiRequest['params'][$key_id], 'version' => $apiRequest['version']);
+ $seek = [$key_id => $apiRequest['params'][$key_id], 'version' => $apiRequest['version']];
$existing = civicrm_api($apiRequest['entity'], 'get', $seek);
if ($existing['is_error']) {
return $existing;
}
$existing = array_pop($existing['values']);
+ // Per Unit test testUpdateHouseholdWithAll we don't want to load these from the DB
+ // if they are not passed in then we'd rather they are calculated.
+ // Note update is not recomended anyway...
+ foreach (['sort_name', 'display_name'] as $fieldToNotSet) {
+ unset($existing[$fieldToNotSet]);
+ }
$p = array_merge($existing, $apiRequest['params']);
return civicrm_api($apiRequest['entity'], 'create', $p);
}