You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Symfony 2.2.0 the error "The CSRF token is invalid. Please try to resubmit the form." is never localized.
When I was upgrading hostnet/form-twig-bridge from Symfony 2.1 to 2.2.1, I found that one of the functional tests was not working, the above seems to be the cause.
In Symfony 2.1.x the error messages were translated inside form_div_layout.html.twig, this was moved. All validation errors in Symfony 2.2, except this one, are translated in ExecutionContext->addViolation, where the $message is translated. So this bug seems to exist since 2.2.0.
The text was updated successfully, but these errors were encountered:
Hi, I've had the same message today in a form with collection. The issue was that I had forgotten form_rest(form) at the bottom of my form. I hope this will help you. Bye.
This PR was merged into the master branch.
Discussion
----------
[Form] Fixed CSRF error messages to be translated and added "csrf_message" option
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7642
| License | MIT
| Doc PR | TODO
Commits
-------
549a308 [Form] Fixed CSRF error messages to be translated and added "csrf_message" option
Since Symfony 2.2.0 the error "The CSRF token is invalid. Please try to resubmit the form." is never localized.
When I was upgrading hostnet/form-twig-bridge from Symfony 2.1 to 2.2.1, I found that one of the functional tests was not working, the above seems to be the cause.
In Symfony 2.1.x the error messages were translated inside form_div_layout.html.twig, this was moved. All validation errors in Symfony 2.2, except this one, are translated in
ExecutionContext->addViolation
, where the$message
is translated. So this bug seems to exist since 2.2.0.The text was updated successfully, but these errors were encountered: