oroinc / platform

Main OroPlatform package with core functionality.
Other
627 stars 351 forks source link

wrong render of item in CollectionType #1087

Open majoskorec opened 2 years ago

majoskorec commented 2 years ago

Summary
symfony add "collection_entry" block prefix to CollectionType entries in 5.1 https://github.com/symfony/symfony/pull/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

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