Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] Custom Form Type with the same name as its parent Symfony form type results in exception upon rednering #58825

Open
@yyaremenko

Description

@yyaremenko

Symfony version(s) affected

7.1.7

Description

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 EmailTypeextends 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 fromEmailType to anything else, e.g.MailType, the form is rendered successfully

How to reproduce

(see description)

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp