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

Appearance settings

[Form][2.8] FormFactory::create ignores getBlockPrefix when generating the name #15760

Copy link
Copy link
Closed
@craue

Description

@craue
Issue body actions

Form type:

use Symfony\Component\Form\AbstractType;

class ModifySettingsForm extends AbstractType {

    public function getBlockPrefix() {
        return 'modifySettings';
    }

}

Now calling

  1. $this->get('form.factory')->createNamed('modifySettings', ModifySettingsForm::class)
  2. $this->createForm(ModifySettingsForm::class)

in a controller leads to different results when rendering the template. While in the 1st case the form name actually is modifySettings, it is modify_settings_form in the 2nd case, so the block prefix is ignored and the name is generated using the class name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.