Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Closed as not planned
Description
Symfony version(s) affected
7.3
Description
When using a TranslatableMessage with an explicitly set domain in a Constraint/Length minMessage the passed domain is ignored and reset to 'validators'.
How to reproduce
class RegistrationFormTypeextends AbstractType{publicfunctionbuildForm(FormBuilderInterface$builder,array$options):void {$builder ... ->add('plainPassword', PasswordType::class, [// ...'constraints' => [// ...newLength(['min' =>8,'minMessage' =>newTranslatableMessage('registration.password.min', [],'forms'),'max' =>4096, ]), ], ]) ; }
forms.en.yaml
registration:password:min:'Your password should be at least {{ limit }} characters'
WebProfiler shows, that Symfony is looking for 'registration.password.min' inside validators domain ignoring the set domain. If you put the same config in validators.en.yaml it works.
I use TranslatableMessage in other constraints aswell and there the passed domain is used.
Possible Solution
No response
Additional Context
No response