From 640aec1debd8106c2909997714df0b19dae8829e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 1 May 2017 14:30:19 -0400 Subject: [PATCH] CRM-20327 - Avoid api chaining errors when replacing value with operators --- api/api.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/api.php b/api/api.php index 1675d9d1aa..5c432630a8 100644 --- a/api/api.php +++ b/api/api.php @@ -136,6 +136,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 = ''; + } } } } -- 2.25.1