Skip to content

Unmapped forms are not validated #11268

Closed
@stof

Description

@stof

This is an issue being there since 2.1.

The FormValidator runs the validation of the underlying object graph in 2 cases:

  • on the root form
  • in case all parents have cascade_validation set to true

This means that when you have a subform with mapped set to false, the only way to have its object graph validation is to enable cascade_validation on all parents of the unmapped field, which will lead to duplicate validation of the object graph of the parent if it uses @Assert\Valid() properly.

As unmapped forms define a new object graph, I think it would make sense to run the validation on them as well.

/cc @webmozart

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