-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] compound forms without children should be considered rendered implicitly #20108
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
hm somehow the first commit from #20080 is missing here? |
Could be related to the revert? |
yes but how do i get it back, do i need to make a new commit or can this just be merged manually via cherrypicking? |
try to amend it to change its hash |
…nsidered rendered
be81463
to
46e8805
Compare
have rebased it onto current 2.7 and collapsed both commits |
@fabpot you have added this bugfix to the 2.7.19 tag, though you reverted the first PR, pls check this one, as the failing test cases are fixed, maybe @webmozart should also review this |
@backbone87 since you modify abstract tests of the Form component, you have to update both TwigBridge and FrameworkBundle dependency to it in their Be sure to run tests on them before pushing, thanks. |
OK, I confirm tests are green. Status: Reviewed |
@@ -453,7 +453,7 @@ public function testNestedFormError() | |||
$form = $this->factory->createNamedBuilder('name', 'form') | |||
->add($this->factory | |||
->createNamedBuilder('child', 'form', null, array('error_bubbling' => false)) | |||
->add('grandChild', 'form') | |||
->add('grandChild', 'text') |
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.
Why this change?
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.
$form->createView()->isRendered()
now returns true, when the whole form tree is compound and would result in this test case failing.
The real change is for $grandChild->createView()->isRendered()
which now returns true in case grandChild is compound. This is because compound forms with no children are considered rendered now, where before each leaf form view (that includes compound forms without children), that doesnt have its rendered flag explicitly set, would not be considered rendered.
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.
Ok it was reverted when I tried on master because of the conflict resolution. So I think you should not make that change and fix the layout test in this case because it does impact form_rest
and this should be tested too.
i would still recommend to wait for a review of @webmozart consider the following usecase: $form = $factory->create(FormType::class, [ 'items' => [] ]);
$form->add('items', CollectionType::class, [ 'entry_type' => TextType::class ]); and the following tpl: {{ form_start(form) }}
{{ form_errors(form) }}
{{ form_row(form.items) }}
{{ form_end(form) }} with this change also see #20080 (comment) for more |
Status: Needs Work |
Sorry I've got the message with delay, yes the choice type is definitely a problem, let's solve this with #17609 instead. |
@backbone87 @HeahDude what's the status here? (rebase needed) |
Closing as there is no more activity. |
second try, obsoletes #20080