Skip to content

[Validation] Always ask value event if field isn't in the validating group #9051

Closed
@metfan

Description

@metfan

Hello,

I'm experiencing trouble with validation. I have a form split in different steps. I have one Entity and use validation_groups to validate each form.

In the validation process I'm using getters to validate complex rule. But data for this rule are set on step2. So a call of the isMyMethod() method will provide an error if it calls before step2.

It seems that Symfony\Component\Validator\Mapping\ClassMetadata call value of all properties and getters even if we use validation_groups. validation_groups will be use later in the process.

To avoid the problem I need to setup form's step in my entity, but normally my entity don't have to care of form's step.

Also I thinks it's a performance issue: if I have 300 rules and validation_groups take care of only 10, I spent time for nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions