Fix master-only regression
authoreileen <emcnaughton@wikimedia.org>
Wed, 24 Feb 2021 21:30:18 +0000 (10:30 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 24 Feb 2021 21:30:18 +0000 (10:30 +1300)
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

index d6c5e51b08c239c444ca31c3b4d31c6537b6df27..f2260f4502d42dcada60b89721db1166dfcbf291 100644 (file)
@@ -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) {