-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] action allows only strings #36297
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
Conversation
Should we also allow |
I'm not sure because by default we have an empty string : https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/FormType.php#L191-L193 |
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 fine with this PR 👍, but could you please add a test covering null to prevent future regressions?Thanks!
@HeahDude done 😉 |
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.
Thanks!
src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php
Outdated
Show resolved
Hide resolved
Side note: this should target 3.4 as bug fix IMO |
@HeahDude I don't know, it could be cause a BC no ? |
The BC break would also happen in master, every bug fix is some kind of BC break since it changes a wrong behavior. The question is do we consider it a bug? I do, but I also agree that casting null to string should be ok. Though, targeting master would mean deprecating passing null first in 5.1, and throw an exception in 6.0 only. |
+1 for 3.4 as bugfix |
Merging it into master instead. Breaking code in a patch release is very different from breaking code in a minor release. So, while I agree this is a bug fix, I don't see the need to fix it in 3.4. |
Thank you @maxhelias. |
On updating an old project that had actions to null it's caused me a type-hint error. With that, we can quickly identify where the problem is