From e162ae91a9ad380869cdb0adac71a176d27626f9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 16 Jun 2022 10:21:24 -0400 Subject: [PATCH] Afform - fix dependency injection for autogenerated forms --- ext/afform/core/Civi/Api4/Action/Afform/Get.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/afform/core/Civi/Api4/Action/Afform/Get.php b/ext/afform/core/Civi/Api4/Action/Afform/Get.php index 54afeb153dd8..793b6eb57833 100644 --- a/ext/afform/core/Civi/Api4/Action/Afform/Get.php +++ b/ext/afform/core/Civi/Api4/Action/Afform/Get.php @@ -45,10 +45,8 @@ public function getRecords() { '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; }