Closed donatascn closed 3 years ago
Seems like your CRUD controller class is not configured properly as a service subscriber.
See https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Controller/CRUDController.php#L91
Normally this sonata.admin.request.fetcher
service is provided within a service locator.
Is your controller service tagged as container.service_subscriber
? If not easiest would be to enable autoconfiguration for it.
We might need to update the doc https://github.com/sonata-project/SonataAdminBundle/blob/4.x/docs/reference/architecture.rst#crudcontroller or some other doc.
Having it in docs would help. Thanks!
Having it in docs would help. Thanks!
Can you do a PR to update the docs with the change you made ? :)
Environment
Sonata
``` $ composer show --latest 'sonata-project/*' Color legend: sonata-project/admin-bundle 4.0.0-rc.2 4.0.0-rc.2 The missing Symfony Admin Generator sonata-project/block-bundle 4.7.0 4.7.0 Symfony SonataBlockBundle sonata-project/cache 2.2.0 2.2.0 Cache library sonata-project/doctrine-extensions 1.13.1 1.13.1 Doctrine2 behavioral extensions sonata-project/doctrine-orm-admin-bundle 4.0.0-rc.2 4.0.0-rc.2 Integrate Doctrine ORM into the SonataAdminBundle sonata-project/exporter 2.7.0 2.7.0 Lightweight Exporter library sonata-project/form-extensions 1.9.0 1.9.0 Symfony form extensions sonata-project/twig-extensions 1.7.0 1.7.0 Sonata twig extensions ```
Symfony
``` $ composer show --latest 'symfony/*' symfony/contracts v1.1.10 v2.4.0 A set of abstractions extracted out of the Symfony components symfony/deprecation-contracts v2.4.0 v2.4.0 A generic function and convention to trigger deprecation notices symfony/maker-bundle v1.31.1 v1.33.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code. symfony/monolog-bundle v3.5.0 v3.7.0 Symfony MonologBundle symfony/phpunit-bridge v4.4.13 v5.3.4 Symfony PHPUnit Bridge symfony/polyfill-apcu v1.18.1 v1.23.0 Symfony polyfill backporting apcu_* functions to lower PHP versions symfony/polyfill-ctype v1.23.0 v1.23.0 Symfony polyfill for ctype functions symfony/polyfill-iconv v1.18.1 v1.23.0 Symfony polyfill for the Iconv extension symfony/polyfill-intl-grapheme v1.22.1 v1.23.1 Symfony polyfill for intl's grapheme_* functions symfony/polyfill-intl-icu v1.22.1 v1.23.0 Symfony polyfill for intl's ICU-related data and classes symfony/polyfill-intl-idn v1.22.1 v1.23.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions symfony/polyfill-intl-normalizer v1.22.1 v1.23.0 Symfony polyfill for intl's Normalizer class and related functions symfony/polyfill-mbstring v1.22.1 v1.23.1 Symfony polyfill for the Mbstring extension symfony/polyfill-php70 v1.20.0 v1.20.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions symfony/polyfill-php72 v1.22.1 v1.23.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions symfony/polyfill-php73 v1.22.1 v1.23.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions symfony/polyfill-php80 v1.22.1 v1.23.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions symfony/polyfill-php81 v1.23.0 v1.23.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions symfony/polyfill-uuid v1.22.1 v1.23.0 Symfony polyfill for uuid functions symfony/psr-http-message-bridge v2.1.0 v2.1.1 PSR HTTP message bridge symfony/security-acl v3.1.1 v3.2.0 Symfony Security Component - ACL (Access Control List) symfony/string v5.3.3 v5.3.3 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way symfony/swiftmailer-bundle v3.3.1 v3.5.2 Symfony SwiftmailerBundle symfony/symfony v4.4.25 v5.3.6 The Symfony PHP framework ```
PHP version
Subject
Getting an error when loading list view of an Admin that has a custom Action defined.
Steps to reproduce
Create a custom Admin action according to this guide and try accessing list view of the Admin
Expected results
List view loads.
Actual results