sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

unknown collection class error when have sonata_type_collection in sonata_type_collection #4786

Closed thibaultfalque closed 6 years ago

thibaultfalque commented 6 years ago

Environment

Linux Mint 18

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.26.0             3.26.0            
sonata-project/block-bundle              3.5.0              3.5.0             
sonata-project/cache                     2.0.0              2.0.0             
sonata-project/core-bundle               3.7.0              3.7.0             
sonata-project/datagrid-bundle           2.3.0              2.3.0             
sonata-project/doctrine-extensions       1.0.2              1.0.2             
sonata-project/doctrine-orm-admin-bundle 3.1.7              3.1.7             
sonata-project/easy-extends-bundle       2.2.0              2.2.0             
sonata-project/exporter                  1.7.1              1.7.1             
sonata-project/formatter-bundle          3.3.0              3.3.0             
sonata-project/media-bundle              3.8.0              3.8.0             
sonata-project/notification-bundle       3.2.0              3.2.0             
sonata-project/user-bundle               dev-master ff710b8 dev-master ff710b8

Symfony packages

$ composer show --latest 'symfony/*'
symfony/monolog-bundle     v3.1.2  v3.1.2  Symfony MonologBundle
symfony/phpunit-bridge     v3.3.13 v3.3.13 Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.6.0  v1.6.0  Symfony polyfill backporting apcu...
symfony/polyfill-intl-icu  v1.6.0  v1.6.0  Symfony polyfill for intl's ICU-r...
symfony/polyfill-mbstring  v1.6.0  v1.6.0  Symfony polyfill for the Mbstring...
symfony/polyfill-php56     v1.6.0  v1.6.0  Symfony polyfill backporting some...
symfony/polyfill-php70     v1.6.0  v1.6.0  Symfony polyfill backporting some...
symfony/polyfill-util      v1.6.0  v1.6.0  Symfony utilities for portability...
symfony/security-acl       v3.0.0  v3.0.0  Symfony Security Component - ACL ...
symfony/swiftmailer-bundle v2.6.7  v3.1.6  Symfony SwiftmailerBundle
symfony/symfony            v3.3.4  v3.3.13 The Symfony PHP framework

PHP version

$ php -v
PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:49:56) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

Subject

This issue is very similar as #1327 but I have not the same error.

I have "Survey Entity", "Question Entity" and "Choice Entity".

I have the class Admin for this different entity.

A survey entity have a list of question so it have a "sonata_type_collection" for this field. ->add('questions', 'sonata_type_collection', array("label" => false, "required" => true), array( 'edit' => 'inline', 'inline' => 'table' ) )

A question have a list of choice and have a "sonata_type_collection" for this field too. ` ->add('choix','sonata_type_collection',array(), array(

                'edit' => 'inline',
                'inline' => 'table'
            ))

`

screenshot-localhost 8000-2017-11-22-15-04-34

If I remove, for choice field, array( 'edit' => 'inline', 'inline' => 'table' )) I have the form in "modal" and works but I don't want a "modal".

Steps to reproduce

Create a field "sonata_tyoe_collection" in an other "sonata_type_collection" with table option.

Expected results

A new form for create a choice.

Actual results

screenshot-localhost 8000-2017-11-22-15-14-29

thibaultfalque commented 6 years ago

Question on stackoverflow

TheFox commented 2 years ago

@thibaultfalque Could you fix it?