[Form] Fixed regression on Collection type
This commit is contained in:
parent
a7e5b4932e
commit
bd686cd1ee
@ -30,7 +30,7 @@ class CollectionType extends AbstractType
|
||||
$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'];
|
||||
|
@ -311,10 +311,12 @@ class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
|
||||
'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 @@ class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
|
||||
'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()
|
||||
|
Reference in New Issue
Block a user