diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php b/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php index 1055b7355953..cba25016a046 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php @@ -30,7 +30,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) $prototypeOptions = array_replace(array( 'required' => $options['required'], 'label' => $options['prototype_name'].'label__', - ), $options['options']); + ), $options['entry_options']); if (null !== $options['prototype_data']) { $prototypeOptions['data'] = $options['prototype_data']; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php index 45c56e1075db..c3416a83951c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php @@ -311,10 +311,12 @@ public function testPrototypeData() 'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType', 'entry_options' => array( 'data' => 'bar', + 'label' => false, ), )); $this->assertSame('foo', $form->createView()->vars['prototype']->vars['value']); + $this->assertFalse($form->createView()->vars['prototype']->vars['label']); } /** @@ -328,9 +330,11 @@ public function testLegacyPrototypeData() 'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType', 'options' => array( 'data' => 'bar', + 'label' => false, ), )); $this->assertSame('bar', $form->createView()->vars['prototype']->vars['value']); + $this->assertFalse($form->createView()->vars['prototype']->vars['label']); } public function testPrototypeDefaultRequired()