8000 [Form] Fixed regression on Collection type · symfony/symfony@bd686cd · GitHub
[go: up one dir, main page]

Skip to content

Commit bd686cd

Browse files
committed
[Form] Fixed regression on Collection type
1 parent a7e5b49 commit bd686cd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3030
$prototypeOptions = array_replace(array(
3131
'required' => $options['required'],
3232
'label' => $options['prototype_name'].'label__',
33-
), $options['options']);
33+
), $options['entry_options']);
3434

3535
if (null !== $options['prototype_data']) {
3636
$prototypeOptions['data'] = $options['prototype_data'];

src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,12 @@ public function testPrototypeData()
311311
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
312312
'entry_options' => array(
313313
'data' => 'bar',
314+
'label' => false,
314315
),
315316
));
316317

317318
$this->assertSame('foo', $form->createView()->vars['prototype']->vars['value']);
319+
$this->assertFalse($form->createView()->vars['prototype']->vars['label']);
318320
}
319321

320322
/**
@@ -328,9 +330,11 @@ public function testLegacyPrototypeData()
328330
'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
329331
'options' => array(
330332
'data' => 'bar',
333+
'label' => false,
331334
),
332335
));
333336
$this->assertSame('bar', $form->createView()->vars['prototype']->vars['value']);
337+
$this->assertFalse($form->createView()->vars['prototype']->vars['label']);
334338
}
335339

336340
public function testPrototypeDefaultRequired()

0 commit comments

Comments
 (0)
0