From 44e2789ffa51590d8542c6d9018ec7a434abdf77 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 25 Feb 2021 10:30:18 +1300 Subject: [PATCH] Fix master-only regression It seems the tests ran before the test that covered this was merged giving a false positive See https://github.com/civicrm/civicrm-core/pull/19478#issuecomment-785388559 for rationale --- CRM/Utils/Array.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Array.php b/CRM/Utils/Array.php index d6c5e51b08..f2260f4502 100644 --- a/CRM/Utils/Array.php +++ b/CRM/Utils/Array.php @@ -62,7 +62,11 @@ class CRM_Utils_Array { * The value of the key, or null if the key is not found. */ public static function retrieveValueRecursive(array $params, string $key) { - if (isset($params[$key])) { + // Note that !empty means funky handling for 0 + // but it is 'baked in'. We should probably deprecate this + // for a more logical approach. + // see https://github.com/civicrm/civicrm-core/pull/19478#issuecomment-785388559 + if (!empty($params[$key])) { return $params[$key]; } foreach ($params as $subParam) { -- 2.25.1