Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Invalid CSRF token never translated since 2.2.0 #7642

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

Closed
nicoschoenmaker opened this issue Apr 12, 2013 · 1 comment
Closed

[Form] Invalid CSRF token never translated since 2.2.0 #7642

nicoschoenmaker opened this issue Apr 12, 2013 · 1 comment

Comments

@nicoschoenmaker
Copy link

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.

@FabRondeau
Copy link

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.

fabpot added a commit that referenced this issue May 3, 2013
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
@fabpot fabpot closed this as completed May 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants