Skip to content

Expression Validator broken #50011

@SebaGnich

Description

@SebaGnich

Symfony version(s) affected

v6.2.8

Description

Hello! I just updated all of my dependencies to v6.2.8 and now the Expression-Validator is broken.

It is probably because of the missing alias validator.expression, removed here:

https://github.com/symfony/framework-bundle/compare/v6.2.7...v6.2.8?diff=split#diff-51cca25b9f344e04d253bf67d646ddaf82a361541effdf554dce3f6d2080dc66L71

The Expression-Class uses it here:
https://github.com/symfony/validator/blob/6.2/Constraints/Expression.php#L88

The Error that I get from PHPUnit Test is:

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

Or am I missing something?

Thanks you very much!

How to reproduce

Update to v6.2.8 and use the Expression Validation like:

#[Expression(expression: 'not (value starts with "01")', message: 'Porting-Prefix is Mobile')]

Run a PHPUnit-Test

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