Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix BC for the default root form name #16758

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

Merged
merged 1 commit into from
Nov 30, 2015
Merged

Conversation

stof
Copy link
Member

@stof stof commented Nov 30, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15760
License MIT
Doc PR n/a

The block prefix is used, to match the previous behavior when using a custom block prefix.

The form type is now retrieved twice from the registry here, but this should not be an issue:

  • unnamed forms are created only at the root, so only once per form at most (child forms are always named explicitly)
  • the registry caches the resolved type, so the second access is just accessing the key in the array and returning it

The block prefix is used, to match the previous behavior when using a
custom block prefix.
@nicolas-grekas
Copy link
Member

👍

1 similar comment
@craue
Copy link
Contributor

craue commented Nov 30, 2015

👍

@fabpot
Copy link
Member

fabpot commented Nov 30, 2015

Thank you @stof.

@fabpot fabpot merged commit 0a54d09 into symfony:2.8 Nov 30, 2015
fabpot added a commit that referenced this pull request Nov 30, 2015
This PR was merged into the 2.8 branch.

Discussion
----------

Fix BC for the default root form name

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #15760
| License       | MIT
| Doc PR        | n/a

The block prefix is used, to match the previous behavior when using a custom block prefix.

The form type is now retrieved twice from the registry here, but this should not be an issue:
- unnamed forms are created only at the root, so only once per form at most (child forms are always named explicitly)
- the registry caches the resolved type, so the second access is just accessing the key in the array and returning it

Commits
-------

0a54d09 Fix BC for the default root form name
@stof stof deleted the form_root_name branch November 30, 2015 13:54
@stof
Copy link
Member Author

stof commented Nov 30, 2015

this code can then be cleaned in the master branch, as ResolvedFormTypeInterface contains the getBlockPrefix method, and so it is always defined

@nicolas-grekas
Copy link
Member

Thank you @stof, see fdb419e for the merge into master

This was referenced Nov 30, 2015
soullivaneuh referenced this pull request in genemu/GenemuFormBundle Jul 6, 2016
fix deprecated function in Select2Type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants