-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Message post_max_size_message not translated #15479
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
Comments
I can confirm this. |
The message is translated through Validator component not in twig here, would you mind forking the standard edition, to reproduce the issue? |
I guess it is not translated any more since this change: #11924 |
hmm, this is indeed missing the translation here |
https://github.com/gharlan/symfony-standard/tree/issue-15479 When the |
ok thanks I'll look into it |
Do you think this is a bug? Should I open a new issue for that? |
…id Badura) This PR was merged into the 2.7 branch. Discussion ---------- [FORM] fix post_max_size_message translation (alt. 2) | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15479, #18543 | License | MIT | Doc PR | - Commits ------- 9d8a5e5 fix post_max_size_message translation
When in a symfony application we upload a big file, this upload causes POST request to exceed PHP post_max_size variable defined in php.ini (if file size exceed post_max_size),
Symfony framework manage this error, but it seems there is a regression -->
In Vendor FormType.php, the function configureOptions set a default attribute 'post_max_size_message' => 'The uploaded file was too large. Please try to upload a smaller file.'
Then in NativeRequestHandler
As we can see, the message $form->getConfig()->getOption('post_max_size_message') is not translated. Or in twig the form errors are displayed without doing a {{ error|trans }} (see in vendor twig templates the definition of the block form_errors) then in our generated html pages we have form errors all translated but this one. All the form error messages must be translated before being passed as a parameter to new FormError(...).
There is the same problem in HttpFoundationRequestHandler.
I verified that all other new FormError(...) declared in vendors take a translated message as parameter and it's the case.
The text was updated successfully, but these errors were encountered: