Skip to content

Commit

Permalink
[Form] Fixed regression on Collection type
Browse files Browse the repository at this point in the history
  • Loading branch information
hason committed Dec 29, 2015
1 parent a7e5b49 commit bd686cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -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'];
Expand Down
Expand Up @@ -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']);
}

/**
Expand All @@ -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()
Expand Down

2 comments on commit bd686cd

@kralos
Copy link

@kralos kralos commented on bd686cd Jan 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one just stung me on symfony/symfony@v2.8.1 Thanks @hason

@enumag
Copy link
Contributor

@enumag enumag commented on bd686cd Jan 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too. Glad it's fixed.

Please sign in to comment.