APIv4 - Allow values to start with a dollar sign in chaining
authorColeman Watts <coleman@civicrm.org>
Tue, 26 Jul 2022 16:42:52 +0000 (12:42 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 26 Jul 2022 16:42:52 +0000 (12:42 -0400)
Fixes dev/core#3754

Civi/Api4/Provider/ActionObjectProvider.php

index 4d6dda02df31f410df5dbf726fb7bf4c31d8ea10..2a48d3165d105a7866411396e5503ab32304f1b7 100644 (file)
@@ -118,7 +118,7 @@ class ActionObjectProvider implements EventSubscriberInterface, ProviderInterfac
     }
     elseif (is_string($val) && strlen($val) > 1 && substr($val, 0, 1) === '$') {
       $key = substr($val, 1);
-      $val = $result[$key] ?? \CRM_Utils_Array::pathGet($result, explode('.', $key));
+      $val = $result[$key] ?? \CRM_Utils_Array::pathGet($result, explode('.', $key)) ?? $val;
     }
   }