8000 Fix issue 49961 see also 49835 · symfony/symfony@fabcb50 · GitHub
[go: up one dir, main page]

Skip to content

Commit fabcb50

Browse files
committed
Fix issue 49961 see also 49835
1 parent 911d6a6 commit fabcb50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CollectionType extends AbstractType
2323
{
2424
public function buildForm(FormBuilderInterface $builder, array $options)
2525
{
26-
$prototypeOptions = null;
26+
$resizeFormListenerPrototypeOptions = null;
2727
if ($options['allow_add'] && $options['prototype']) {
2828
$prototypeOptions = array_replace([
2929
'required' => $options['required'],
@@ -36,6 +36,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
3636

3737
$prototype = $builder->create($options['prototype_name'], $options['entry_type'], $prototypeOptions);
3838
$builder->setAttribute('prototype', $prototype->getForm());
39+
40+
$resizeFormListenerPrototypeOptions = array_replace($options['entry_options'], $options['prototype_options']);
3941
}
4042

4143
$resizeListener = new ResizeFormListener(
@@ -44,7 +46,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
4446
$options['allow_add'],
4547
$options['allow_delete'],
4648
$options['delete_empty'],
47-
$prototypeOptions
49+
$resizeFormListenerPrototypeOptions
4850
);
4951

5052
$builder->addEventSubscriber($resizeListener);

0 commit comments

Comments
 (0)
0