-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Update FormEnctypeNode.php to fix 12824 #12825
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
@@ -22,7 +22,7 @@ class FormEnctypeNode extends SearchAndRenderBlockNode | |||
public function compile(\Twig_Compiler $compiler) | |||
{ | |||
parent::compile($compiler); | |||
|
|||
$compiler->write('trigger_error(\'The helper form_enctype(form) is deprecated since version 2.3 and will be removed in 3.0. Use form_start(form) instead.\', E_USER_DEPRECATED)'); | |||
|
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 will fix this ;)
I see an issue here anyway: This assumes that the function call is its own statement. Adding a semi-colon before will not fix the issue, it will just change it. The issue is that Twig does not ensure that function calls are their own statement (quite the opposite actually), so this way to trigger the deprecation notice is just broken. |
add missing semi-colon
Any suggestion how this can be fixed properly? |
The problem persists and I don't see any clean way to trigger deprecation notice here. You could use some sort of a hack, like:
It would echo an empty string, trigger the warning and then go on with the compilation, but as I said it is ugly. I'm affraid, the only way to trigger the deprecation warning in a clean, nice matter would be to change
add something like
and rewrite the |
if there is no proper solution, can we just revert the change? this is completely breaking things, as in that way, it is certainly and utterly pointless breaking BC... |
did #13125 to re-add the call to |
As there is no way to get it right, I've reverted #12673 |
alright, thanks fabien! |
I found that in #8731 the semi-colon was actually removed because of a problem with using the sandbox.
Which is properly why this was no longer noticed.
This is the simplest way to fix the syntax error.