Skip to content

Improve error exception for unsubmitted form #49619

Closed
@garak

Description

@garak

Description

I was helping another Symfony user in a community, he was stuck with a form and he posted the following screenshot

image

So I explained to him the reason for this failure, but then I realized that indeed the exception message is misleading. As we know, it's not sufficient to call the Form::isSubmitted() method to ensure that the form is actually submitted.

The message should be changed to something like this:

Cannot check if an unsubmitted form is valid. Call Form::isSubmitted() and ensure that it's true before calling Form::isValid().

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions