You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I do:
I create a custom form type for an emali field, which has a name colliding with a Symfony's form type, as following:
<?phpnamespaceApp\Form\User;
useSymfony\Component\Form\Extension\Core\Type\EmailTypeasBaseEmailType;
useSymfony\Component\Form\AbstractType;
useSymfony\Component\OptionsResolver\OptionsResolver;
class EmailType extends AbstractType
{
publicfunctionconfigureOptions(OptionsResolver$resolver): void
{
$resolver->setDefaults([
// ... defaults are set here
]);
}
publicfunctiongetParent(): string
{
return BaseEmailType::class;
}
}
What I expect:
The form is rendered to the end user.
What I get:
An exception rendered to the end user:
An exception has been thrown during the rendering of a template ("Unable to render the form because the block names array contains duplicates: "_sign_up_email_row", "email_row", "email_row", "text_row", "form_row".").
Experiment:
If I change my form type class name from EmailType to anything else, e.g. MailType, the form is rendered successfully