Skip to content

Improve the 'post_max_size_message' for form that don't include file uploads. #35011

@stefanospetrakis

Description

@stefanospetrakis

Symfony version(s) affected
All

Description
When POST-ing a form that exceeds the post_max_size limit of PHP, the Symfony validation message should not be exclusively about file uploads, since we can have forms submitted without any file uploads, which could lead to confusion.

Suggestion
Before: 'The uploaded file was too large. Please try to upload a smaller file.'
After: 'The combination of submitted content and uploaded files was too large. Please try to reduce the size of the submitted content or upload smaller files.'

Example

By setting php.ini to a really small value:

post_max_size=2

and submitting a form with a simple text field (TextType::class),

image

the resulting error is:

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions