Skip to content

Constraint validator "validator.expression" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "Symfony\Component\Validator\Constraints\Expression". #49998

@SakhriHoussem

Description

@SakhriHoussem

Symfony version(s) affected

6.2.8

Description

the constraint Expression does not work on symfony 6.2.8

How to reproduce

to reproduce use constraint Expression:

    #[Assert\When(
        expression: 'this.is360FeedBack()',
        constraints: [
            new Assert\Sequentially([
                new Assert\NotNull,
                new Assert\Expression(
                    'this.isValidModel()',
                    message: "exception.model.not_valid"),
            ])
        ],
    )]

Possible Solution

No response

Additional Context

No response

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