-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] fix BC break introduced with prototype_data option #17044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\CollectionType', array(), array( | ||
'allow_add' => true, | ||
'prototype' => true, | ||
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be type
@HeahDude thanks! Made new commit, now test is passing. |
))); | ||
), $options['options']); | ||
|
||
if ($options['prototype_data'] !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symfony CS prefers to use Yoda conditions: if (null !== $options['prototype_data']) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sstok thanks! Fixed
👍 |
Thank you @memphys. |
…(memphys) This PR was squashed before being merged into the 2.8 branch (closes #17044). Discussion ---------- [Form] fix BC break introduced with prototype_data option | Q | A | ------------- | --- | Bug fix? | [yes] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [no] | Fixed tickets | [#15707] | License | MIT | Doc PR | [] This fixes the BC break introduced with prototype_data option in collection type. At the moment whether option is set or not it overwrites prototype data but it has different behaviour before and prototype data was taken from the mapped form data/entity. - [x] make the test work (can't figure yet how to test that prototype without prototype_data option has default values) Commits ------- d73485a [Form] fix BC break introduced with prototype_data option
@fabpot with pleasure! |
This PR was merged into the 2.8 branch. Discussion ---------- [Form] Fix regression on Collection type Q | A --- | --- Bug fix? | yes New feature? | no BC breaks? | no Deprecations? | no Tests pass? | yes Fixed tickets | License | MIT Doc PR | A regression was introduced in #17044. Commits ------- bd686cd [Form] Fixed regression on Collection type
This fixes the BC break introduced with prototype_data option in collection type. At the moment whether option is set or not it overwrites prototype data but it has different behaviour before and prototype data was taken from the mapped form data/entity.