Skip to content

Remove wrong deprecation triggers for forms in the DI extension #15740

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
Sep 9, 2015

Conversation

stof
Copy link
Member

@stof stof commented Sep 9, 2015

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

When a form type provides a BC layer with old form names (all core types do), the form registry will ask for type extensions registered on the legacy name for BC, and trigger a warning if it finds any.
The DependencyInjectionExtension should not trigger warnings on its own when being asked for such extensions (especially when it has none registered). this means that the extension does not even need to know whether the name is a legacy one or a new one btw.
Core extensions are also registered using the proper extended type rather than legacy names.

When a form type provides a BC layer with old form names (all core types
do), the form registry will ask for type extensions registered on the
legacy name for BC, and trigger a warning if it finds any.
The DependencyInjectionExtension should not trigger warnings on its own
when being asked for such extensions (especially when it has none
registered).
Core extensions are also registered using the proper extended type
rather than legacy names.
@nicolas-grekas
Copy link
Member

👍

@stof
Copy link
Member Author

stof commented Sep 9, 2015

@nicolas-grekas it would be great to have green builds again when tests are passing. (the HHVM issue making the test fail is annoying for instance)

@nicolas-grekas
Copy link
Member

Yeah, see #15617, someone needs to work on it

@Tobion
Copy link
Contributor

Tobion commented Sep 9, 2015

👍

Status: Reviewed

@Tobion
Copy link
Contributor

Tobion commented Sep 9, 2015

Good catch, thanks Christophe.

@Tobion Tobion merged commit e42adf7 into symfony:2.8 Sep 9, 2015
Tobion added a commit that referenced this pull request Sep 9, 2015
…tension (stof)

This PR was merged into the 2.8 branch.

Discussion
----------

Remove wrong deprecation triggers for forms in the DI extension

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

When a form type provides a BC layer with old form names (all core types do), the form registry will ask for type extensions registered on the legacy name for BC, and trigger a warning if it finds any.
The DependencyInjectionExtension should not trigger warnings on its own when being asked for such extensions (especially when it has none registered). this means that the extension does not even need to know whether the name is a legacy one or a new one btw.
Core extensions are also registered using the proper extended type rather than legacy names.

Commits
-------

e42adf7 Remove wrong deprecation triggers for forms in the DI extension
@stof stof deleted the fix_form_deprecations branch September 9, 2015 16:06
fabpot added a commit that referenced this pull request Sep 15, 2015
…ions (stof)

This PR was merged into the 2.8 branch.

Discussion
----------

Validate the extended type for lazy-loaded type extensions

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | not really
| BC breaks?    | yes, but only for broken setups
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Symfony 2.1 introduced such validation for form types because a mismatch would actually break the logic (the name is accessed again later).
This was not added for type extensions because in such case, ``getExtendedType`` would actually never be used for extensions loaded by the DI extension (this method is only used inside extensions, and the DI extension relies on the service configuration instead). However, having mismatching values there would make debugging much harder, and can hide mistakes (see #15740 for such a mistake being fixed in the core). It also means that it might be hard to fix usage of deprecated APIs as the code might not contain the same extended type than the one used in the fullstack usage.

Commits
-------

8826d39 Validate the extended type for lazy-loaded type extensions
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.

4 participants