From 673f8d52f81d306c39dc6b3e69b3d97cb7a437b0 Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Thu, 20 Nov 2025 09:12:53 +0100 Subject: [PATCH 1/3] Augment fields --- src/Forms/Tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/Tags.php b/src/Forms/Tags.php index f44018e7c65..c55f9520711 100644 --- a/src/Forms/Tags.php +++ b/src/Forms/Tags.php @@ -69,7 +69,7 @@ public function create() $jsDriver = $this->parseJsParamDriverAndOptions($this->params->get('js'), $form); $data['form_config'] = ($configFields = Form::extraConfigFor($form->handle())) - ? Blueprint::makeFromTabs($configFields)->fields()->addValues($form->data()->all())->values()->all() + ? Blueprint::makeFromTabs($configFields)->fields()->addValues($form->data()->all())->augment()->values()->all() : []; $data['sections'] = $this->getSections($this->sessionHandle(), $jsDriver); From 1b4a2e7787ba4a6084e47b402260f402a1f3a9ad Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Thu, 20 Nov 2025 09:36:31 +0100 Subject: [PATCH 2/3] Add test --- tests/Tags/Form/FormCreateTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Tags/Form/FormCreateTest.php b/tests/Tags/Form/FormCreateTest.php index 3be2cc95ad7..03c4fd9fa19 100644 --- a/tests/Tags/Form/FormCreateTest.php +++ b/tests/Tags/Form/FormCreateTest.php @@ -1004,4 +1004,21 @@ public function it_adds_appended_config_fields() $this->assertStringStartsWith('
', $output); $this->assertStringContainsString('This is a test config value', $output); } + + #[Test] + public function it_augments_appended_config_fields() + { + Form::appendConfigFields('*', 'Fields', [ + 'test_config' => ['type' => 'bard', 'display' => 'A Bard field'], + ]); + + tap(Form::find('contact')->data( + ['test_config' => [['type' => 'paragraph', 'content' => [['type' => 'text', 'text' => 'Shut up, Malacoustix!']]]]]) + )->save(); + + $output = $this->tag('{{ form:contact redirect="/submitted" error_redirect="/errors" class="form" id="form" }}{{ form_config:test_config }}{{ /form:contact }}'); + + $this->assertStringStartsWith('', $output); + $this->assertStringContainsString('

Shut up, Malacoustix!

', $output); + } } From e9c481f5fe15f6c25d98a216c597267368f253a8 Mon Sep 17 00:00:00 2001 From: Marco Rieser Date: Thu, 20 Nov 2025 09:38:13 +0100 Subject: [PATCH 3/3] Cleanup test --- tests/Tags/Form/FormCreateTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Tags/Form/FormCreateTest.php b/tests/Tags/Form/FormCreateTest.php index 03c4fd9fa19..e771b2d468c 100644 --- a/tests/Tags/Form/FormCreateTest.php +++ b/tests/Tags/Form/FormCreateTest.php @@ -1018,7 +1018,6 @@ public function it_augments_appended_config_fields() $output = $this->tag('{{ form:contact redirect="/submitted" error_redirect="/errors" class="form" id="form" }}{{ form_config:test_config }}{{ /form:contact }}'); - $this->assertStringStartsWith('', $output); $this->assertStringContainsString('

Shut up, Malacoustix!

', $output); } }