Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 479d8ee

Browse filesBrowse files
committed
bug #33688 Add missing row_attr option to FormType (mcsky)
This PR was merged into the 4.3 branch. Discussion ---------- Add missing row_attr option to FormType | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix: #33682 - related issue #33573 | License | MIT The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown. This PR basically add the option and give it to the form view (like `label_attr` do) Commits ------- d711ea2 Add missing row_attr option to FormType
2 parents a53732f + d711ea2 commit 479d8ee
Copy full SHA for 479d8ee

File tree

5 files changed

+7
-0
lines changed
Filter options

5 files changed

+7
-0
lines changed

‎src/Symfony/Component/Form/Extension/Core/Type/BaseType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/BaseType.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
101101
'attr' => $options['attr'],
102102
'block_prefixes' => $blockPrefixes,
103103
'unique_block_prefix' => $uniqueBlockPrefix,
104+
'row_attr' => $options['row_attr'],
104105
'translation_domain' => $translationDomain,
105106
'label_translation_parameters' => $labelTranslationParameters,
106107
'attr_translation_parameters' => $attrTranslationParameters,
@@ -125,6 +126,7 @@ public function configureOptions(OptionsResolver $resolver)
125126
'disabled' => false,
126127
'label' => null,
127128
'label_format' => null,
129+
'row_attr' => [],
128130
'label_translation_parameters' => [],
129131
'attr_translation_parameters' => [],
130132
'attr' => [],
@@ -134,5 +136,6 @@ public function configureOptions(OptionsResolver $resolver)
134136

135137
$resolver->setAllowedTypes('block_prefix', ['null', 'string']);
136138
$resolver->setAllowedTypes('attr', 'array');
139+
$resolver->setAllowedTypes('row_attr', 'array');
137140
}
138141
}

‎src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_1.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_1.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"post_max_size_message",
5252
"property_path",
5353
"required",
54+
"row_attr",
5455
"translation_domain",
5556
"upload_max_size_message"
5657
]

‎src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_1.txt

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_1.txt
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Symfony\Component\Form\Extension\Core\Type\ChoiceType (Block prefix: "choice")
3131
post_max_size_message
3232
property_path
3333
required
34+
row_attr
3435
translation_domain
3536
upload_max_size_message
3637
--------------------------- -------------------- ------------------------------ -----------------------

‎src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_2.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_2.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"post_max_size_message",
3232
"property_path",
3333
"required",
34+
"row_attr",
3435
"translation_domain",
3536
"trim",
3637
"upload_max_size_message"

‎src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_2.txt

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Fixtures/Descriptor/resolved_form_type_2.txt
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Symfony\Component\Form\Extension\Core\Type\FormType (Block prefix: "form")
3333
post_max_size_message
3434
property_path
3535
required
36+
row_attr
3637
translation_domain
3738
trim
3839
upload_max_size_message

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.