File tree Expand file tree Collapse file tree 3 files changed +32
-4
lines changed
Expand file tree Collapse file tree 3 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -416,8 +416,6 @@ file that was distributed with this source code.
416416
417417{% block sonata_type_immutable_array_widget %}
418418 <div {{ block (' widget_container_attributes' ) }}>
419- {{ form_help(form ) }}
420-
421419 {% for key , child in form %}
422420 {{ block (' sonata_type_immutable_array_widget_row' ) }}
423421 {% endfor %}
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ protected function configureFormFields(FormMapper $form): void
7575 'elements ' ,
7676 ImmutableArrayType::class,
7777 [
78- 'help ' => 'elements help message ' ,
78+ 'help ' => 'Elements main field help message ' ,
7979 'error_bubbling ' => false ,
8080 'constraints ' => [
8181 new Collection ([
@@ -91,7 +91,7 @@ protected function configureFormFields(FormMapper $form): void
9191 'elements_item ' ,
9292 TextType::class,
9393 [
94- 'help ' => 'elements_item help message ' ,
94+ 'help ' => 'Elements sub field help message ' ,
9595 ],
9696 ],
9797 ],
Original file line number Diff line number Diff line change @@ -76,6 +76,36 @@ public function testCollectionErrorMessageIsDisplayOnce(): void
7676 );
7777 }
7878
79+ /**
80+ * @see https://github.com/sonata-project/SonataAdminBundle/issues/8328
81+ */
82+ public function testImmutableArrayHelpAttributeIsDisplayed (): void
83+ {
84+ $ client = static ::createClient ();
85+ $ crawler = $ client ->request (Request::METHOD_GET , '/admin/tests/app/foo/create ' );
86+
87+ static ::assertSame (Response::HTTP_OK , $ client ->getResponse ()->getStatusCode ());
88+ static ::assertCount (
89+ 1 ,
90+ $ crawler ->filter ('.help-block.sonata-ba-field-help:contains("Elements main field help message") ' )
91+ );
92+ }
93+
94+ /**
95+ * @see https://github.com/sonata-project/SonataAdminBundle/issues/8328
96+ */
97+ public function testImmutableArrayKeysItemHelpAttributeAreDisplayed (): void
98+ {
99+ $ client = static ::createClient ();
100+ $ crawler = $ client ->request (Request::METHOD_GET , '/admin/tests/app/foo/create ' );
101+
102+ static ::assertSame (Response::HTTP_OK , $ client ->getResponse ()->getStatusCode ());
103+ static ::assertCount (
104+ 1 ,
105+ $ crawler ->filter ('.help-block.sonata-ba-field-help:contains("Elements sub field help message") ' )
106+ );
107+ }
108+
79109 /**
80110 * https://github.com/sonata-project/SonataAdminBundle/issues/6904.
81111 */
You can’t perform that action at this time.
0 commit comments