Skip to content

[Form] Update the 'post_max_size_message' #35013

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

stefanospetrakis
Copy link

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #35011
License MIT
Doc PR

Small validation message update to avoid confusion when a form doesn't contain uploaded files and still results in a POST action with content that exceeds the post_max_size limit of PHP.

@stefanospetrakis
Copy link
Author

This change would - probably - cause updating all the translations for this message; not sure how demanding that task would be, I couldn't translate all these on my own as part of this PR for sure.

N.B.: Adding this as a draft PR since it is not complete due to this.

@stefanospetrakis stefanospetrakis changed the title Updated the 'post_max_size_message' [Form] Updated the 'post_max_size_message' Dec 17, 2019
@stefanospetrakis stefanospetrakis changed the title [Form] Updated the 'post_max_size_message' [Form] Update the 'post_max_size_message' Dec 17, 2019
@ro0NL
Copy link
Contributor

ro0NL commented Dec 17, 2019

Regarding the message, i agree it's incorrect and shouldnt assume "uploaded files" which ultimately is a subset of any "submitted content".

See #31788 + #30931 regarding the topic of changing messages ... it's not simple indeed, so this PR may join the club :)

I tend to believe we should switch the source code to use abstract message keys (i.e. form.post_max_size_exceeded). That would overcome any future BC issues (until we want to update the actual keys, but it should be less likely).

English translations could be provided staticly, in case the Translator is unavailable, thus FormMessage::fromKey('form.post_max_size_exceeded') or so.

@nicolas-grekas
Copy link
Member

Instead of changing the source code, shouldn't we change the target in validators.en.xlf?

@nicolas-grekas nicolas-grekas added this to the next milestone Dec 26, 2019
@stefanospetrakis
Copy link
Author

Yes, that would fix the output and the reported problem in the easiest way.

I still think the original source/string is misleading and I would prefer to fix that in the code of the FormType class. Plus, the change in validators.en.xlf would result in the source and target strings being different which would appear a tiny-bit inconsistent looking at the other two translations in that same xlf file.

@nicolas-grekas
Copy link
Member

I'm closing because:

  1. we have no upgrade path to update all languages
  2. the new message is technically more accurate, but that makes it more obscure to final non-techy users - so I'm not sure it's even better, from a UX perspective.

Feels free to resubmit if you have a proposal to fix those issues.
Thanks for submitting.

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the 'post_max_size_message' for form that don't include file uploads.
4 participants