Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
backbone87 wants to merge1 commit intosymfony:2.7frombackbone87:ticket/17580

Conversation

@backbone87
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?possibly
Deprecations?no
Tests pass?yes
Fixed tickets#17580
LicenseMIT
Doc PRn/a

second try, obsoletes#20080

@backbone87
Copy link
ContributorAuthor

hm somehow the first commit from#20080 is missing here?

@linaori
Copy link
Contributor

Could be related to the revert?

@backbone87
Copy link
ContributorAuthor

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?

@HeahDude
Copy link
Contributor

try to amend it to change its hash

@backbone87
Copy link
ContributorAuthor

have rebased it onto current 2.7 and collapsed both commits

@backbone87
Copy link
ContributorAuthor

@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

@HeahDude
Copy link
Contributor

@backbone87 since you modify abstract tests of the Form component, you have to update both TwigBridge and FrameworkBundle dependency to it in theircomposer.json to~2.7.20|~2.8.13|~3.1.6.

Be sure to run tests on them before pushing, thanks.

@HeahDude
Copy link
Contributor

OK, I confirm tests are green.

Status: Reviewed

->add($this->factory
->createNamedBuilder('child','form',null,array('error_bubbling' =>false))
->add('grandChild','form')
->add('grandChild','text')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why this change?

Copy link
ContributorAuthor

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.

Copy link
Contributor

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 impactform_rest and this should be tested too.

@backbone87
Copy link
ContributorAuthor

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{{ form_row(form.items) }} will not outputanything, becauseform.items.rendered istrue andhttps://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/FormRenderer.php#L158 prevents rendering of form views, that are already rendered (either explicitly or implicitly). I dont think the behavior of the renderer is good in this case. If i requestform.items to be rendered explicitly, i dont want the renderer to deny that because of some internal state.

also see#20080 (comment) for more

@HeahDude
Copy link
Contributor

Status: Needs Work

@HeahDude
Copy link
Contributor

Sorry I've got the message with delay, yes the choice type is definitely a problem, let's solve this with#17609 instead.

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneDec 6, 2016
@nicolas-grekas
Copy link
Member

@backbone87@HeahDude what's the status here? (rebase needed)

@fabpot
Copy link
Member

Closing as there is no more activity.

@fabpotfabpot closed thisMar 31, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@HeahDudeHeahDudeHeahDude left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

6 participants

@backbone87@linaori@HeahDude@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp