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

Symfony 4.3 Sonata\Form\Type\CollectionType does not show collections #6191

Closed dima-gr closed 3 years ago

dima-gr commented 4 years ago
sonata-project/admin-bundle              3.68.0  The missing Symfony Admin Generator
sonata-project/block-bundle              3.20.0  Symfony SonataBlockBundle
sonata-project/cache                     2.0.1   Cache library
sonata-project/core-bundle               3.20.0  Symfony SonataCoreBundle (abandoned)
sonata-project/doctrine-extensions       1.6.0   Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.13.0  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/exporter                  2.2.0   Lightweight Exporter library
sonata-project/form-extensions           0.1.2   Symfony form extensions
sonata-project/translation-bundle        2.5.0   SonataTranslationBundle
sonata-project/twig-extensions           0.1.1   Sonata twig extensions

symfony:

symfony/asset                            v4.3.11 Symfony Asset Component
symfony/browser-kit                      v4.3.11 Symfony BrowserKit Component
symfony/cache                            v4.3.11 Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts                  v1.1.7  Generic abstractions related to caching
symfony/config                           v4.3.11 Symfony Config Component
symfony/console                          v4.3.11 Symfony Console Component
symfony/css-selector                     v4.3.11 Symfony CssSelector Component
symfony/debug                            v4.3.11 Symfony Debug Component
symfony/debug-bundle                     v4.3.11 Symfony DebugBundle
symfony/debug-pack                       v1.0.8  A debug pack for Symfony projects
symfony/dependency-injection             v4.3.11 Symfony DependencyInjection Component
symfony/doctrine-bridge                  v4.3.11 Symfony Doctrine Bridge
symfony/dom-crawler                      v4.3.11 Symfony DomCrawler Component
symfony/dotenv                           v4.3.11 Registers environment variables from a .env file
symfony/event-dispatcher                 v4.3.11 Symfony EventDispatcher Component
symfony/event-dispatcher-contracts       v1.1.7  Generic abstractions related to dispatching event
symfony/expression-language              v4.3.11 Symfony ExpressionLanguage Component
symfony/filesystem                       v4.3.11 Symfony Filesystem Component
symfony/finder                           v4.3.11 Symfony Finder Component
symfony/flex                             v1.8.4  Composer plugin for Symfony
symfony/form                             v4.3.11 Symfony Form Component
symfony/framework-bundle                 v4.3.11 Symfony FrameworkBundle
symfony/http-foundation                  v4.3.11 Symfony HttpFoundation Component
symfony/http-kernel                      v4.3.11 Symfony HttpKernel Component
symfony/inflector                        v4.3.11 Symfony Inflector Component
symfony/intl                             v4.3.11 A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/maker-bundle                     v1.19.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                             v4.3.11 A library to manipulate MIME messages
symfony/monolog-bridge                   v4.3.11 Symfony Monolog Bridge
symfony/monolog-bundle                   v3.5.0  Symfony MonologBundle
symfony/options-resolver                 v4.3.11 Symfony OptionsResolver Component
symfony/orm-pack                         v1.0.8  A pack for the Doctrine ORM
symfony/phpunit-bridge                   v5.1.2  Symfony PHPUnit Bridge
symfony/polyfill-intl-grapheme           v1.17.1 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu                v1.17.1 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn                v1.17.1 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer         v1.17.1 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring                v1.17.1 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                   v1.17.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73                   v1.17.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80                   v1.17.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-uuid                    v1.17.1 Symfony polyfill for uuid functions
symfony/process                          v4.3.11 Symfony Process Component
symfony/profiler-pack                    v1.0.4  A pack for the Symfony web profiler
symfony/property-access                  v4.3.11 Symfony PropertyAccess Component
symfony/property-info                    v4.3.11 Symfony Property Info Component
symfony/routing                          v4.3.11 Symfony Routing Component
symfony/security-acl                     v3.0.4  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle                  v4.3.11 Symfony SecurityBundle
symfony/security-core                    v4.3.11 Symfony Security Component - Core Library
symfony/security-csrf                    v4.3.11 Symfony Security Component - CSRF Library
symfony/security-guard                   v4.3.11 Symfony Security Component - Guard
symfony/security-http                    v4.3.11 Symfony Security Component - HTTP Integration
symfony/serializer                       v4.3.11 Symfony Serializer Component
symfony/serializer-pack                  v1.0.3  A pack for the Symfony serializer
symfony/service-contracts                v1.1.8  Generic abstractions related to writing services
symfony/stopwatch                        v4.3.11 Symfony Stopwatch Component
symfony/string                           v5.1.2  Symfony String component
symfony/swiftmailer-bundle               v3.4.0  Symfony SwiftmailerBundle
symfony/templating                       v4.3.11 Symfony Templating Component
symfony/test-pack                        v1.0.6  A pack for functional and end-to-end testing within a Symfony app
symfony/translation                      v4.3.11 Symfony Translation Component
symfony/translation-contracts            v1.1.7  Generic abstractions related to translation
symfony/twig-bridge                      v4.3.11 Symfony Twig Bridge
symfony/twig-bundle                      v4.3.11 Symfony TwigBundle
symfony/validator                        v4.3.11 Symfony Validator Component
symfony/var-dumper                       v4.3.11 Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                     v4.3.11 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/web-link                         v4.3.11 Symfony WebLink Component
symfony/web-profiler-bundle              v4.3.11 Symfony WebProfilerBundle
symfony/web-server-bundle                v4.3.11 Symfony WebServerBundle
symfony/webpack-encore-bundle            v1.7.3  Integration with your Symfony app & Webpack Encore!
symfony/yaml                             v4.3.11 Symfony Yaml Component
twig/extensions                          v1.5.4  Common additional features for Twig that do not directly belong in core
twig/extra-bundle                        v3.0.3  A Symfony bundle for extra Twig extensions
twig/string-extra                        v3.0.3  A Twig extension for Symfony String
twig/twig                                v2.12.5 Twig, the flexible, fast, and secure template language for PHP

php version:

PHP 7.2.31 (cli) (built: Jun 9 2020 15:23:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.31, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans

use Sonata\Form\Type\CollectionType as Collection;

            ->add('contacts', Collection::class, [
                'by_reference' => false,
                'label' => false
            ], [
                'inline' => 'table'
            ])

Contacts are saved, but the list of saved contacts not displayed

VincentLanglet commented 4 years ago

Try this way

->add('contacts', Collection::class, [
                'by_reference' => false,
                'label' => false
            ], [
                'edit' => 'inline'
                'inline' => 'table'
            ])

Does it work ?

But there is still something wrong IMHO. If you not provide an edit, it should used one by default and have a proper display.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.