Sonataadminbundle: [SF4.4] GenerateObjectAclCommand seems incompatible with doctrine/doctrine-bundle:2.0.0 (which is introduced by sonata-project/doctrine-orm-admin-bundle:3.12.0)

Created on 25 Nov 2019  路  2Comments  路  Source: sonata-project/SonataAdminBundle

Environment

Sonata packages

$ composer show --latest 'sonata-project/*'
sonata-project/admin-bundle              3.54.1 3.54.1 The missing Symfony Admin Generator
sonata-project/block-bundle              3.18.2 3.18.2 Symfony SonataBlockBundle
sonata-project/cache                     2.0.1  2.0.1  Cache library
sonata-project/core-bundle               3.17.0 3.17.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.5.0  3.0.1  Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.3.1  1.3.1  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.12.0 3.12.0 Symfony Sonata / Integrate Doctrine ORM into the So...
sonata-project/exporter                  2.0.1  2.0.1  Lightweight Exporter library
sonata-project/intl-bundle               2.7.0  2.7.0  Symfony SonataIntlBundle

Symfony packages

$ composer show --latest 'symfony/*'
symfony/apache-pack                v1.0.1  v1.0.1  A pack for Apache support in Symfony
symfony/asset                      v4.4.0  v5.0.0  Symfony Asset Component
symfony/browser-kit                v5.0.0  v5.0.0  Symfony BrowserKit Component
symfony/cache                      v5.0.0  v5.0.0  Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts            v2.0.0  v2.0.0  Generic abstractions related to caching
symfony/config                     v4.4.0  v5.0.0  Symfony Config Component
symfony/console                    v4.4.0  v5.0.0  Symfony Console Component
symfony/css-selector               v4.4.0  v5.0.0  Symfony CssSelector Component
symfony/debug                      v4.4.0  v4.4.0  Symfony Debug Component
symfony/debug-bundle               v4.4.0  v5.0.0  Symfony DebugBundle
symfony/dependency-injection       v4.4.0  v5.0.0  Symfony DependencyInjection Component
symfony/doctrine-bridge            v4.4.0  v5.0.0  Symfony Doctrine Bridge
symfony/dom-crawler                v5.0.0  v5.0.0  Symfony DomCrawler Component
symfony/dotenv                     v4.4.0  v5.0.0  Registers environment variables from a .env file
symfony/error-handler              v4.4.0  v5.0.0  Symfony ErrorHandler Component
symfony/event-dispatcher           v4.4.0  v5.0.0  Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.7  v2.0.0  Generic abstractions related to dispatching event
symfony/expression-language        v4.4.0  v5.0.0  Symfony ExpressionLanguage Component
symfony/filesystem                 v4.4.0  v5.0.0  Symfony Filesystem Component
symfony/finder                     v4.4.0  v5.0.0  Symfony Finder Component
symfony/flex                       v1.4.8  v1.4.8  Composer plugin for Symfony
symfony/form                       v4.4.0  v5.0.0  Symfony Form Component
symfony/framework-bundle           v4.4.0  v5.0.0  Symfony FrameworkBundle
symfony/http-client                v5.0.0  v5.0.0  Symfony HttpClient component
symfony/http-client-contracts      v2.0.0  v2.0.0  Generic abstractions related to HTTP clients
symfony/http-foundation            v4.4.0  v5.0.0  Symfony HttpFoundation Component
symfony/http-kernel                v4.4.0  v5.0.0  Symfony HttpKernel Component
symfony/inflector                  v5.0.0  v5.0.0  Symfony Inflector Component
symfony/intl                       v4.4.0  v5.0.0  A PHP replacement layer for the C intl extension that i...
symfony/maker-bundle               v1.14.3 v1.14.3 Symfony Maker helps you create empty commands, controll...
symfony/mime                       v5.0.0  v5.0.0  A library to manipulate MIME messages
symfony/monolog-bridge             v5.0.0  v5.0.0  Symfony Monolog Bridge
symfony/monolog-bundle             v3.5.0  v3.5.0  Symfony MonologBundle
symfony/options-resolver           v4.4.0  v5.0.0  Symfony OptionsResolver Component
symfony/orm-pack                   v1.0.7  v1.0.7  A pack for the Doctrine ORM
symfony/phpunit-bridge             v5.0.0  v5.0.0  Symfony PHPUnit Bridge
symfony/polyfill-ctype             v1.12.0 v1.12.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu          v1.12.0 v1.12.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn          v1.12.0 v1.12.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf...
symfony/polyfill-mbstring          v1.12.0 v1.12.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72             v1.12.0 v1.12.0 Symfony polyfill backporting some PHP 7.2+ features to ...
symfony/polyfill-php73             v1.12.0 v1.12.0 Symfony polyfill backporting some PHP 7.3+ features to ...
symfony/process                    v4.4.0  v5.0.0  Symfony Process Component
symfony/profiler-pack              v1.0.4  v1.0.4  A pack for the Symfony web profiler
symfony/property-access            v4.4.0  v5.0.0  Symfony PropertyAccess Component
symfony/property-info              v5.0.0  v5.0.0  Symfony Property Info Component
symfony/proxy-manager-bridge       v4.4.0  v5.0.0  Symfony ProxyManager Bridge
symfony/requirements-checker       v1.1.5  v1.1.5  Check Symfony requirements and give recommendations
symfony/routing                    v4.4.0  v5.0.0  Symfony Routing Component
symfony/security-acl               v3.0.2  v3.0.2  Symfony Security Component - ACL (Access Control List)
symfony/security-bundle            v4.4.0  v5.0.0  Symfony SecurityBundle
symfony/security-core              v4.4.0  v5.0.0  Symfony Security Component - Core Library
symfony/security-csrf              v4.4.0  v5.0.0  Symfony Security Component - CSRF Library
symfony/security-guard             v4.4.0  v5.0.0  Symfony Security Component - Guard
symfony/security-http              v4.4.0  v5.0.0  Symfony Security Component - HTTP Integration
symfony/serializer                 v5.0.0  v5.0.0  Symfony Serializer Component
symfony/serializer-pack            v1.0.2  v1.0.2  A pack for the Symfony serializer
symfony/service-contracts          v2.0.0  v2.0.0  Generic abstractions related to writing services
symfony/stopwatch                  v5.0.0  v5.0.0  Symfony Stopwatch Component
symfony/swiftmailer-bundle         v3.4.0  v3.4.0  Symfony SwiftmailerBundle
symfony/templating                 v4.4.0  v5.0.0  Symfony Templating Component
symfony/test-pack                  v1.0.6  v1.0.6  A pack for functional and end-to-end testing within a S...
symfony/translation                v4.4.0  v5.0.0  Symfony Translation Component
symfony/translation-contracts      v2.0.0  v2.0.0  Generic abstractions related to translation
symfony/twig-bridge                v4.4.0  v5.0.0  Symfony Twig Bridge
symfony/twig-bundle                v4.4.0  v5.0.0  Symfony TwigBundle
symfony/validator                  v4.4.0  v5.0.0  Symfony Validator Component
symfony/var-dumper                 v5.0.0  v5.0.0  Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter               v5.0.0  v5.0.0  A blend of var_export() + serialize() to turn any seria...
symfony/web-link                   v4.4.0  v5.0.0  Symfony WebLink Component
symfony/web-profiler-bundle        v5.0.0  v5.0.0  Symfony WebProfilerBundle
symfony/web-server-bundle          v4.4.0  v4.4.0  Symfony WebServerBundle
symfony/webpack-encore-bundle      v1.7.1  v1.7.1  Integration with your Symfony app & Webpack Encore!
symfony/yaml                       v4.4.0  v5.0.0  Symfony Yaml Component

PHP version

$ php -v
PHP 7.3.11 (cli) (built: Oct 26 2019 06:24:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies

Subject

Sonata\AdminBundle\Command\GenerateObjectAclCommand is incompatible with doctrine/doctrine-bundle:2.0.0, which is introduced with the sonata-project/doctrine-orm-admin-bundle:3.12.0 release.

However not sure how this should be fixed, as GenerateObjectAclCommand currently relies on the (deprecated) Symfony\Bridge\Doctrine\RegistryInterface. The GenerateObjectAclCommand only uses the getEntityNamespace of the RegistryInterface, and the referred replacement Doctrine\Common\Persistence\ManagerRegistry does not include the getEntityNamespace function.

Steps to reproduce

Run bin/console in a project with the packages named above and doctrine/doctrine-bundle:2.0.0

Expected results

No error when running bin/console

Actual results

Argument 3 passed to Sonata\AdminBundle\Command\GenerateObjectAclCommand::__construct() must be an instance of Symfony\Bridge\Doctrine\RegistryInterface or null, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in /xxx/var/cache/docker/ContainerSZBCWrj/getGenerateObjectAclCommandService
  .php on line 9
Easy Pick bug

Most helpful comment

which is introduced by sonata-project/doctrine-orm-admin-bundle:3.12.0

It's allowed though, not required, which means a simple workaround is to require doctrine-bundle 1. Thanks for reporting this issue though.

All 2 comments

which is introduced by sonata-project/doctrine-orm-admin-bundle:3.12.0

It's allowed though, not required, which means a simple workaround is to require doctrine-bundle 1. Thanks for reporting this issue though.

Or requiring the latest version of the admin bundle

Was this page helpful?
0 / 5 - 0 ratings