[Form] Fix ChoiceType translation domain
This commit is contained in:
parent
13982b5809
commit
2effda79ea
@ -386,7 +386,7 @@ class ChoiceType extends AbstractType
|
||||
'value' => $choiceView->value,
|
||||
'label' => $choiceView->label,
|
||||
'attr' => $choiceView->attr,
|
||||
'translation_domain' => $options['translation_domain'],
|
||||
'translation_domain' => $options['choice_translation_domain'],
|
||||
'block_name' => 'entry',
|
||||
];
|
||||
|
||||
|
@ -1994,6 +1994,24 @@ class ChoiceTypeTest extends BaseTypeTest
|
||||
$this->assertEquals('_09name', $view->vars['full_name']);
|
||||
}
|
||||
|
||||
public function testSubFormTranslationDomain()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||
'label' => 'label',
|
||||
'translation_domain' => 'label_translation_domain',
|
||||
'choices' => [
|
||||
'choice1' => true,
|
||||
'choice2' => false,
|
||||
],
|
||||
'choice_translation_domain' => 'choice_translation_domain',
|
||||
'expanded' => true,
|
||||
])->createView();
|
||||
|
||||
$this->assertCount(2, $form->children);
|
||||
$this->assertSame('choice_translation_domain', $form->children[0]->vars['translation_domain']);
|
||||
$this->assertSame('choice_translation_domain', $form->children[1]->vars['translation_domain']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideTrimCases
|
||||
*/
|
||||
|
Reference in New Issue
Block a user