Skip to content

[Validator] Since symfony/validator 6.2: The "loose" mode is deprecated. The default mode will be changed to "html5" in 7.0. #48541

Closed
@oojacoboo

Description

@oojacoboo

Symfony version(s) affected

6.2.0

Description

Getting the following error:

Since symfony/validator 6.2: The "loose" mode is deprecated. The default mode will be changed to "html5" in 7.0.

I'm unable to locate anywhere VALIDATION_MODE_LOOSE is being used in our code. Looking at the stack-traces, I keep running into the following:

/srv/www/vendor/symfony/deprecation-contracts/function.php:25
/srv/www/vendor/symfony/validator/Constraints/EmailValidator.php:46
/srv/www/vendor/symfony/validator/ConstraintValidatorFactory.php:40
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:735
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:588
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:502
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:299
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:647
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:502
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:299
/srv/www/vendor/symfony/validator/Validator/RecursiveContextualValidator.php:133
/srv/www/vendor/symfony/validator/Validator/RecursiveValidator.php:82

It's also erroring out on files that aren't even calling the Email constraint. It seems like a faulty check, or there is missing documentation on BC breaks with regards to this.

How to reproduce

So, the Validator is initialized like so:

$builder = Validation::createValidatorBuilder();
$validator = $builder->enableAnnotationMapping(true)->getValidator();

Other than this, I'm getting errors on files that don't even use the Email assertion.

Possible Solution

Downgrade to symfony/validator 6.1.7

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