Afform.get - Fix warning/test-failure when trying to load non-existent record
authorTim Otten <totten@civicrm.org>
Thu, 19 Dec 2019 04:56:49 +0000 (20:56 -0800)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:20 +0000 (19:13 -0700)
ext/afform/core/Civi/Api4/Action/Afform/Get.php

index 13288cc7394bbbb9f4d8467f684ad20d30b9fdcb..0f16028e97867e9f7176001030466775ff28621e 100644 (file)
@@ -19,7 +19,9 @@ class Get extends \Civi\Api4\Generic\BasicGetAction {
     $values = [];
     foreach ($names as $name) {
       $record = $scanner->getMeta($name);
-      $record = array_merge($record, $scanner->getComputedFields($name));
+      if ($record) {
+        $record = array_merge($record, $scanner->getComputedFields($name));
+      }
       $layout = $this->_isFieldSelected('layout') ? $scanner->getLayout($name) : NULL;
       if ($layout !== NULL) {
         // FIXME check for validity?