Afform - fix dependency injection for autogenerated forms
authorColeman Watts <coleman@civicrm.org>
Thu, 16 Jun 2022 14:21:24 +0000 (10:21 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 16 Jun 2022 14:21:24 +0000 (10:21 -0400)
ext/afform/core/Civi/Api4/Action/Afform/Get.php

index 54afeb153dd8f448b17ae2f626f811e3ed5eae80..793b6eb57833b8bb14799d23d531c498790d745c 100644 (file)
@@ -45,10 +45,8 @@ class Get extends \Civi\Api4\Generic\BasicGetAction {
         'has_base' => TRUE,
         'type' => 'form',
       ];
-      if ($afform['type'] === 'form') {
-        // afCore and af would normally get required by AngularDependencyMapper but that only works on file-based afforms
-        $afform['requires'] = array_unique(array_merge(['afCore', 'af'], $afform['requires'] ?? []));
-      }
+      // afCore and af would normally get required by AngularDependencyMapper but that only works on file-based afforms
+      $afform['requires'] = array_unique(array_merge(['afCore', 'af'], $afform['requires'] ?? []));
       if (!in_array($name, $names)) {
         $names[] = $name;
       }