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); diff --git a/tests/Tags/Form/FormCreateTest.php b/tests/Tags/Form/FormCreateTest.php index 3be2cc95ad7..e771b2d468c 100644 --- a/tests/Tags/Form/FormCreateTest.php +++ b/tests/Tags/Form/FormCreateTest.php @@ -1004,4 +1004,20 @@ 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->assertStringContainsString('

Shut up, Malacoustix!

', $output); + } }