X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fapi.php;h=04b0421bcbb213757ab02e81d11882094e97e891;hb=08f3d81d13ca6db1da65d76d2abe38ac18df9cf1;hp=1675d9d1aa0066a326d147a91802699df2d909ba;hpb=cb4100bc439690c0cd4840286377d1de7cbaf345;p=civicrm-core.git diff --git a/api/api.php b/api/api.php index 1675d9d1aa..04b0421bcb 100644 --- a/api/api.php +++ b/api/api.php @@ -129,6 +129,10 @@ function _civicrm_api_get_camel_name($entity) { */ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = '.') { foreach ($params as $field => &$value) { + if (substr($field, 0, 4) == 'api.') { + // CRM-21246 - Leave nested calls alone. + continue; + } if (is_string($value) && substr($value, 0, 6) == '$value') { $value = _civicrm_api_replace_variable($value, $parentResult, $separator); } @@ -136,6 +140,10 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = ' elseif (is_array($value) && is_string(reset($value)) && substr(reset($value), 0, 6) == '$value') { $key = key($value); $value[$key] = _civicrm_api_replace_variable($value[$key], $parentResult, $separator); + // A null value with an operator will cause an error, so remove it. + if ($value[$key] === NULL) { + $value = ''; + } } } }