-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed #58937
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
[FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed #58937
Conversation
nicolas-grekas
commented
Nov 20, 2024
Q | A |
---|---|
Branch? | 7.2 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Issues | Fix symfony/recipes#1358 |
License | MIT |
…g components are not installed
038faa8
to
596487b
Compare
@@ -4,6 +4,7 @@ | |||
'annotations' => false, | |||
'csrf_protection' => false, | |||
'form' => [ | |||
'enabled' => true, |
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.
While we change tests to make this PR pass, this won't affect end user's project: the auto-enable will still rely on the required packages being installed. Here, we have to be explicit because FullStack::class is found.
->children() | ||
->scalarNode('enabled')->defaultNull()->end() // defaults to !class_exists(FullStack::class) && class_exists(Form::class) |
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 changing this one ? enabling form based on the presence of the form component was right here. This is what $enableIfStandalone
is doing. and the canBeEnabled
and canBeDisabled
methods of symfony/config have an additional behavior: setting any other setting implicitly enables it (losing that behavior is the reason why you had to update tests)
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.
because of https://github.com/symfony/recipes/pull/1337/files, which requires being able to set some defaults without enabling forms while symfony/form isn't installed
alternatives are way too complex (recipes relying on many components being installed is not possible)
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 setting this in the FrameworkBundle recipe instead of the recipe of components, as done for other component-specific config ?
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.
Btw, this is a BC break for people using the fullstack framework package (which is discouraged, but might still be done) as it means the form component would not be enabled anymore if they only have other settings set.
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.
I'm in favor of a specific csrf recipe as well. We do this for other optional framework config options as well (e.g. messenger, mailer)
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.
Please check symfony/recipes#1361
…hen the corresponding components are not installed" (nicolas-grekas) This PR was merged into the 7.2 branch. Discussion ---------- [FrameworkBundle] Revert " Don't auto-register form/csrf when the corresponding components are not installed" | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT As discussed in #58937 (comment) This still keeps https://github.com/symfony/symfony/pull/58937/files#diff-041b166c698c254a3f61cfc6390785d4f5097794b77a4b2f3f888996729cbce4R214 to make symfony/recipes#1361 work out of the box. Commits ------- 05149ae Revert "bug #58937 [FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed (nicolas-grekas)"
* 7.2: Revert "bug #58937 [FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed (nicolas-grekas)" Fix merge fix: ignore missing directory in isVendor() [OptionsResolver] Allow Union/Intersection Types in Resolved Closures Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass(). Dynamically fix compatibility with doctrine/data-fixtures v2 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception don't call EntityManager::initializeObject() with scalar values [FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed make RelayProxyTrait compatible with relay extension 0.9.0 [Validator] review italian translations Update PR template
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [symfony/debug-bundle](https://symfony.com) ([source](https://redirect.github.com/symfony/debug-bundle)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/doctrine-messenger](https://symfony.com) ([source](https://redirect.github.com/symfony/doctrine-messenger)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/dotenv](https://symfony.com) ([source](https://redirect.github.com/symfony/dotenv)) | `7.1.9` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/framework-bundle](https://symfony.com) ([source](https://redirect.github.com/symfony/framework-bundle)) | `7.1.6` -> `7.2.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/mailer](https://symfony.com) ([source](https://redirect.github.com/symfony/mailer)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/messenger](https://symfony.com) ([source](https://redirect.github.com/symfony/messenger)) | `7.1.9` -> `7.2.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/phpunit-bridge](https://symfony.com) ([source](https://redirect.github.com/symfony/phpunit-bridge)) | `7.1.9` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/runtime](https://symfony.com) ([source](https://redirect.github.com/symfony/runtime)) | `7.1.7` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/security-bundle](https://symfony.com) ([source](https://redirect.github.com/symfony/security-bundle)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/stopwatch](https://symfony.com) ([source](https://redirect.github.com/symfony/stopwatch)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/twig-bundle](https://symfony.com) ([source](https://redirect.github.com/symfony/twig-bundle)) | `7.1.6` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/ux-twig-component](https://symfony.com) ([source](https://redirect.github.com/symfony/ux-twig-component)) | `2.21.0` -> `2.22.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [symfony/web-profiler-bundle](https://symfony.com) ([source](https://redirect.github.com/symfony/web-profiler-bundle)) | `7.1.9` -> `7.2.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>symfony/debug-bundle (symfony/debug-bundle)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/debug-bundle/compare/v7.1.6...v7.2.0) [Compare Source](https://redirect.github.com/symfony/debug-bundle/compare/v7.1.6...v7.2.0) </details> <details> <summary>symfony/doctrine-messenger (symfony/doctrine-messenger)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/doctrine-messenger/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/doctrine-messenger/compare/v7.1.6...v7.2.0) **Changelog** (symfony/doctrine-messenger@v7.2.0-RC1...v7.2.0) - no significant changes </details> <details> <summary>symfony/dotenv (symfony/dotenv)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/dotenv/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/dotenv/compare/v7.1.9...v7.2.0) **Changelog** (symfony/dotenv@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#59007](https://redirect.github.com/symfony/symfony/issues/59007) \[Dotenv] read runtime config from composer.json in debug dotenv command ([@​xabbuh](https://redirect.github.com/xabbuh)) </details> <details> <summary>symfony/framework-bundle (symfony/framework-bundle)</summary> ### [`v7.2.1`](https://redirect.github.com/symfony/framework-bundle/releases/tag/v7.2.1) [Compare Source](https://redirect.github.com/symfony/framework-bundle/compare/v7.2.0...v7.2.1) **Changelog** (symfony/framework-bundle@v7.2.0...v7.2.1) - bug [symfony/symfony#59122](https://redirect.github.com/symfony/symfony/issues/59122) \[Notifier] fix desktop channel bus abstract arg ([@​raphael-geffroy](https://redirect.github.com/raphael-geffroy)) - bug [symfony/symfony#59124](https://redirect.github.com/symfony/symfony/issues/59124) \[FrameworkBundle] fix: notifier push channel bus abstract arg ([@​raphael-geffroy](https://redirect.github.com/raphael-geffroy)) - bug [symfony/symfony#59086](https://redirect.github.com/symfony/symfony/issues/59086) \[FrameworkBundle] Make uri_signer lazy and improve error when kernel.secret is empty ([@​nicolas-grekas](https://redirect.github.com/nicolas-grekas)) ### [`v7.2.0`](https://redirect.github.com/symfony/framework-bundle/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/framework-bundle/compare/v7.1.6...v7.2.0) **Changelog** (symfony/framework-bundle@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#58950](https://redirect.github.com/symfony/symfony/issues/58950) \[FrameworkBundle] Revert " Deprecate making `cache.app` adapter taggable" (@​keulinho) - bug [symfony/symfony#58943](https://redirect.github.com/symfony/symfony/issues/58943) \[FrameworkBundle] Revert " Don't auto-register form/csrf when the corresponding components are not installed" ([@​nicolas-grekas](https://redirect.github.com/nicolas-grekas)) - bug [symfony/symfony#58937](https://redirect.github.com/symfony/symfony/issues/58937) \[FrameworkBundle] Don't auto-register form/csrf when the corresponding components are not installed ([@​nicolas-grekas](https://redirect.github.com/nicolas-grekas)) - bug [symfony/symfony#58885](https://redirect.github.com/symfony/symfony/issues/58885) \[PropertyInfo]\[Serializer]\[TypeInfo]\[Validator] TypeInfo 7.1 compatibility ([@​mtarld](https://redirect.github.com/mtarld)) - bug [symfony/symfony#58834](https://redirect.github.com/symfony/symfony/issues/58834) \[FrameworkBundle] ensure `validator.translation_domain` parameter is always set (@​xabbuh) </details> <details> <summary>symfony/mailer (symfony/mailer)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/mailer/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/mailer/compare/v7.1.6...v7.2.0) **Changelog** (symfony/mailer@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#58888](https://redirect.github.com/symfony/symfony/issues/58888) \[Mailer]\[Notifier] Sweego is backing their bridges, thanks to them! ([@​nicolas-grekas](https://redirect.github.com/nicolas-grekas)) </details> <details> <summary>symfony/messenger (symfony/messenger)</summary> ### [`v7.2.1`](https://redirect.github.com/symfony/messenger/releases/tag/v7.2.1) [Compare Source](https://redirect.github.com/symfony/messenger/compare/v7.2.0...v7.2.1) **Changelog** (symfony/messenger@v7.2.0...v7.2.1) - no significant changes ### [`v7.2.0`](https://redirect.github.com/symfony/messenger/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/messenger/compare/v7.1.9...v7.2.0) **Changelog** (symfony/messenger@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#58952](https://redirect.github.com/symfony/symfony/issues/58952) \[Cache] silence warnings issued by Redis Sentinel on connection issues ([@​xabbuh](https://redirect.github.com/xabbuh)) - bug [symfony/symfony#58862](https://redirect.github.com/symfony/symfony/issues/58862) \[Notifier] Fix GoIpTransport ([@​nicolas-grekas](https://redirect.github.com/nicolas-grekas)) - bug [symfony/symfony#58818](https://redirect.github.com/symfony/symfony/issues/58818) \[Messenger] silence PHP warnings issued by `Redis::connect()` (@​xabbuh) </details> <details> <summary>symfony/phpunit-bridge (symfony/phpunit-bridge)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/phpunit-bridge/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/phpunit-bridge/compare/v7.1.9...v7.2.0) **Changelog** (symfony/phpunit-bridge@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#58828](https://redirect.github.com/symfony/symfony/issues/58828) \[PhpUnitBridge] fix dumping tests to skip with data providers ([@​xabbuh](https://redirect.github.com/xabbuh)) </details> <details> <summary>symfony/runtime (symfony/runtime)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/runtime/compare/v7.1.7...v7.2.0) [Compare Source](https://redirect.github.com/symfony/runtime/compare/v7.1.7...v7.2.0) </details> <details> <summary>symfony/security-bundle (symfony/security-bundle)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/security-bundle/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/security-bundle/compare/v7.1.6...v7.2.0) **Changelog** (symfony/security-bundle@v7.2.0-RC1...v7.2.0) - no significant changes </details> <details> <summary>symfony/stopwatch (symfony/stopwatch)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/stopwatch/compare/v7.1.6...v7.2.0) [Compare Source](https://redirect.github.com/symfony/stopwatch/compare/v7.1.6...v7.2.0) </details> <details> <summary>symfony/twig-bundle (symfony/twig-bundle)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/twig-bundle/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/twig-bundle/compare/v7.1.6...v7.2.0) **Changelog** (symfony/twig-bundle@v7.2.0-RC1...v7.2.0) - no significant changes </details> <details> <summary>symfony/ux-twig-component (symfony/ux-twig-component)</summary> ### [`v2.22.1`](https://redirect.github.com/symfony/ux-twig-component/compare/v2.22.0...v2.22.1) [Compare Source](https://redirect.github.com/symfony/ux-twig-component/compare/v2.22.0...v2.22.1) ### [`v2.22.0`](https://redirect.github.com/symfony/ux-twig-component/compare/v2.21.0...v2.22.0) [Compare Source](https://redirect.github.com/symfony/ux-twig-component/compare/v2.21.0...v2.22.0) </details> <details> <summary>symfony/web-profiler-bundle (symfony/web-profiler-bundle)</summary> ### [`v7.2.0`](https://redirect.github.com/symfony/web-profiler-bundle/releases/tag/v7.2.0) [Compare Source](https://redirect.github.com/symfony/web-profiler-bundle/compare/v7.1.9...v7.2.0) **Changelog** (symfony/web-profiler-bundle@v7.2.0-RC1...v7.2.0) - bug [symfony/symfony#58919](https://redirect.github.com/symfony/symfony/issues/58919) \[WebProfilerBundle] Twig deprecations ([@​mazodude](https://redirect.github.com/mazodude)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/Runroom/archetype-symfony). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuNTguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->