Skip to content

wrong render of item in CollectionType #1087

Open
@majoskorec

Description

@majoskorec

Summary
symfony add "collection_entry" block prefix to CollectionType entries in 5.1
symfony/symfony#36088

it cause that entity type in collection in collection is rendering as input type

Steps to reproduce

final class TestType extends Abstract`Type
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('coll1', \Oro\Bundle\FormBundle\Form\Type\CollectionType::class, [
            'entry_type' => Test2Type::class,
            'allow_add' => true,
            'allow_delete' => true,
            'prototype' => true,
            'handle_primary' => false,
        ]);
    }
}

final class Test2Type extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('coll2', \Oro\Bundle\FormBundle\Form\Type\CollectionType::class, [
            'entry_type' => EntityType::class,
            'entry_options' => [
                'class' => User::class,
            ],
            'allow_add' => true,
            'allow_delete' => true,
            'prototype' => true,
            'handle_primary' => false,
        ]);
    }
}

Actual Result
coll2 is text input
image

Expected Result
coll2 should by entity select type

Details about your environment

  • OroPlatform version: 5.*
  • PHP version: 8.1.*
  • Database MySQL version 8.0

Additional information
when i remove "collection_entry" from block prefix of CollectionType it start working

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions