Skip to content

[FrameworkBundle] deprecate not setting http_method_override #45989

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

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Apr 11, 2022

Q A
Branch? 6.1
Bug fix? no
New feature? no
Deprecations? yey
Tickets Fix #45278
License MIT
Doc PR

In preparation for changing the default in 7.0.

->fixXmlConfig('enabled_locale')
->children()
->scalarNode('secret')->end()
->scalarNode('http_method_override')
->booleanNode('http_method_override')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only boolean node that wasn't defined as such and missed validation.

->info("Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests. Note: When using the HttpCache, you need to call the method in your front controller instead")
->defaultTrue()
->treatNullLike(false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently setting it to null caused a type error in the FrameworkExtension which is now fixed. making it a boolean node still permits null. so this also ensures that null is transformed to false (instead of true which is the default in boolean node)

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM. Please add CHANGELOG+UPGRADE entries

@Tobion
Copy link
Contributor Author

Tobion commented Apr 13, 2022

@nicolas-grekas I need to adapt tests don't I? The option needs to be set in alot of functional tests.

@nicolas-grekas
Copy link
Member

yes indeed

@Tobion
Copy link
Contributor Author

Tobion commented Apr 19, 2022

@nicolas-grekas is there a way to ignore this deprecation notice in Symfony tests when it's self triggered. otherwise I have to explicitly set the http_method_override: false in hundrets of test fixtures. kinda ugly and pointless.
There are 114 yml files alone. Then the likely the same amount in xml and php.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Apr 19, 2022

Nope there's none, and that's on purpose to me: eat our own dog food. We're asking ppl to opt-in, including ourselves.

@GromNaN GromNaN changed the title [FrameworkBundle] deprecate not setting http_method_overwrite [FrameworkBundle] deprecate not setting http_method_override Apr 19, 2022
@Tobion
Copy link
Contributor Author

Tobion commented Apr 19, 2022

Well, users will not be affected when using the recipes. And the people who are, only need to change 1 line. We have to adjust hundrets of unrelated tests.

@Tobion Tobion force-pushed the deprecate-not-setting-http-method-overwrite branch from 8b29d0d to 9be468f Compare April 20, 2022 13:27
@Tobion Tobion force-pushed the deprecate-not-setting-http-method-overwrite branch 5 times, most recently from e1df1f7 to a156313 Compare April 20, 2022 14:19
@Tobion
Copy link
Contributor Author

Tobion commented Apr 20, 2022

I fixed the tests and adding changelog/upgrade. This is ready now.

@fabpot fabpot force-pushed the deprecate-not-setting-http-method-overwrite branch from a156313 to f9cf24a Compare April 21, 2022 06:09
@fabpot
Copy link
Member

fabpot commented Apr 21, 2022

Thank you @Tobion.

@fabpot fabpot merged commit d838f46 into symfony:6.1 Apr 21, 2022
@Tobion Tobion deleted the deprecate-not-setting-http-method-overwrite branch June 9, 2022 13:57
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.

Disable http_method_override by default
5 participants