Closed
Description
Symfony version(s) affected
6.2.2
Description
When using command "php bin/console translation:extract --force fr" to extract translations, I receive the following error exception:
Warning: Undefined variable $messages
If you use constraints without translatable field, the messages array isn't defined.
How to reproduce
Create an entity with the following constraint:
@RollerworksPassword\PasswordStrength(minLength=6, minStrength=3)
Use command "php bin/console translation:extract --force fr"
Possible Solution
Modify the code of ConstraintVisitor.php (line 97) to check if messages array is defined:
if(isset($messages)) { foreach($messages as $message) { $this->addMessageToCatalogue($message, 'validators', $node->getStartLine()); } }
Additional Context
No response