$result = ['values' => [0 => $oldResult]];
}
+ // Keys which should not be assumed to be chain calls
+ $blacklist = ['api.has_parent', 'api_params'];
// Scan the params for chain calls.
foreach ($params as $field => $newparams) {
- if ((is_array($newparams) || $newparams === 1) && $field <> 'api.has_parent' && substr($field, 0, 3) == 'api') {
+ if ((is_array($newparams) || $newparams === 1) && !in_array($field, $blacklist, TRUE) && substr($field, 0, 3) == 'api') {
// This param is a chain call, e.g. api.<entity>.<action>
// 'api.participant.delete' => 1 is a valid options - handle 1
// FIXME: Why doesn't creating a campaign clear caches?
civicrm_api3($entityName, 'getfields', ['cache_clear' => 1]);
}
+ if (!empty($specs['serialize'])) {
+ $entity[$field] = (array) $entity[$field];
+ }
$updateParams = [
'id' => $entity['id'],
$field => $entity[$field] ?? NULL,