sonata-project/admin-bundle 3.44.0 3.44.0 The missing Symfony Admin Generator
sonata-project/block-bundle 3.14.0 3.14.0 Symfony SonataBlockBundle
sonata-project/cache 2.0.1 2.0.1 Cache library
sonata-project/classification-bundle 3.7.1 3.7.1 Symfony SonataClassificationBundle
sonata-project/core-bundle 3.14.0 3.14.0 Symfony SonataCoreBundle
sonata-project/datagrid-bundle 2.4.0 2.4.0 Symfony SonataDatagridBundle
sonata-project/doctrine-extensions 1.1.3 1.1.3 Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.7.0 3.7.0 Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle 2.5.0 2.5.0 Symfony SonataEasyExtendsBundle
sonata-project/exporter 1.11.0 2.0.0 Lightweight Exporter library
sonata-project/formatter-bundle 3.5.0 4.1.2 Symfony SonataFormatterBundle
sonata-project/media-bundle 3.17.1 3.17.1 Symfony SonataMediaBundle
sonata-project/user-bundle 4.2.3 4.2.3 Symfony SonataUserBundle
symfony/asset v4.2.2 v4.2.2 Symfony Asset Component
symfony/browser-kit v4.2.2 v4.2.2 Symfony BrowserKit Component
symfony/cache v4.2.2 v4.2.2 Symfony Cache component with PSR-6, PSR-16, and tags
symfony/config v4.2.2 v4.2.2 Symfony Config Component
symfony/console v4.2.2 v4.2.2 Symfony Console Component
symfony/contracts v1.0.2 v1.0.2 A set of abstractions extracted out of the Symfony components
symfony/css-selector v4.2.2 v4.2.2 Symfony CssSelector Component
symfony/debug v4.2.2 v4.2.2 Symfony Debug Component
symfony/debug-bundle v4.2.2 v4.2.2 Symfony DebugBundle
symfony/debug-pack v1.0.7 v1.0.7 A debug pack for Symfony projects
symfony/dependency-injection v4.2.2 v4.2.2 Symfony DependencyInjection Component
symfony/doctrine-bridge v4.2.2 v4.2.2 Symfony Doctrine Bridge
symfony/dom-crawler v4.2.2 v4.2.2 Symfony DomCrawler Component
symfony/dotenv v4.2.2 v4.2.2 Registers environment variables from a .env file
symfony/event-dispatcher v4.2.2 v4.2.2 Symfony EventDispatcher Component
symfony/expression-language v4.2.2 v4.2.2 Symfony ExpressionLanguage Component
symfony/filesystem v4.2.2 v4.2.2 Symfony Filesystem Component
symfony/finder v4.2.2 v4.2.2 Symfony Finder Component
symfony/flex v1.1.8 v1.1.8 Composer plugin for Symfony
symfony/form v4.2.2 v4.2.2 Symfony Form Component
symfony/framework-bundle v4.2.2 v4.2.2 Symfony FrameworkBundle
symfony/http-foundation v4.2.2 v4.2.2 Symfony HttpFoundation Component
symfony/http-kernel v4.2.2 v4.2.2 Symfony HttpKernel Component
symfony/inflector v4.2.2 v4.2.2 Symfony Inflector Component
symfony/intl v4.2.2 v4.2.2 A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/lts dev-master c1affae dev-master c1affae Enforces Long Term Supported versions of Symfony components
Package symfony/lts is abandoned, you should avoid using it. Use symfony/flex instead.
symfony/maker-bundle v1.11.2 v1.11.2 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about...
symfony/monolog-bridge v4.2.2 v4.2.2 Symfony Monolog Bridge
symfony/monolog-bundle v3.3.1 v3.3.1 Symfony MonologBundle
symfony/options-resolver v4.2.2 v4.2.2 Symfony OptionsResolver Component
symfony/orm-pack v1.0.5 v1.0.5 A pack for the Doctrine ORM
symfony/phpunit-bridge v4.2.2 v4.2.2 Symfony PHPUnit Bridge
symfony/polyfill-ctype v1.10.0 v1.10.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-icu v1.10.0 v1.10.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.10.0 v1.10.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.10.0 v1.10.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process v4.2.2 v4.2.2 Symfony Process Component
symfony/profiler-pack v1.0.4 v1.0.4 A pack for the Symfony web profiler
symfony/property-access v4.2.2 v4.2.2 Symfony PropertyAccess Component
symfony/property-info v4.2.2 v4.2.2 Symfony Property Info Component
symfony/proxy-manager-bridge v4.2.2 v4.2.2 Symfony ProxyManager Bridge
symfony/routing v4.2.2 v4.2.2 Symfony Routing Component
symfony/security-acl v3.0.1 v3.0.1 Symfony Security Component - ACL (Access Control List)
symfony/security-bundle v4.2.2 v4.2.2 Symfony SecurityBundle
symfony/security-core v4.2.2 v4.2.2 Symfony Security Component - Core Library
symfony/security-csrf v4.2.2 v4.2.2 Symfony Security Component - CSRF Library
symfony/security-guard v4.2.2 v4.2.2 Symfony Security Component - Guard
symfony/security-http v4.2.2 v4.2.2 Symfony Security Component - HTTP Integration
symfony/serializer v4.2.2 v4.2.2 Symfony Serializer Component
symfony/serializer-pack v1.0.2 v1.0.2 A pack for the Symfony serializer
symfony/stopwatch v4.2.2 v4.2.2 Symfony Stopwatch Component
symfony/swiftmailer-bundle v3.2.5 v3.2.5 Symfony SwiftmailerBundle
symfony/templating v4.2.2 v4.2.2 Symfony Templating Component
symfony/translation v4.2.2 v4.2.2 Symfony Translation Component
symfony/twig-bridge v4.2.2 v4.2.2 Symfony Twig Bridge
symfony/twig-bundle v4.2.2 v4.2.2 Symfony TwigBundle
symfony/validator v4.2.2 v4.2.2 Symfony Validator Component
symfony/var-dumper v4.2.2 v4.2.2 Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter v4.2.2 v4.2.2 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/web-link v4.2.2 v4.2.2 Symfony WebLink Component
symfony/web-profiler-bundle v4.2.2 v4.2.2 Symfony WebProfilerBundle
symfony/web-server-bundle v4.2.2 v4.2.2 Symfony WebServerBundle
symfony/webpack-encore-pack v1.0.3 v1.0.3 A pack for Symfony Encore
symfony/yaml v4.2.2 v4.2.2 Symfony Yaml Component
PHP 7.2.12
White page without exceptions or debug window and error at log:
[2019-01-14 13:55:08] php.INFO: User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The Sonata\CoreBundle\Twig\Extension\FlashMessageExtension class is deprecated since version 3.x and will be removed in 4.0. Use Sonata\Twig\Extension\FlashMessageExtension instead. at /ProjectDir/vendor/sonata-project/core-bundle/src/CoreBundle/Twig/Extension/FlashMessageExtension.php:22)"} []
[2019-01-14 13:55:08] php.INFO: User Deprecated: The "Symfony\Component\HttpKernel\Kernel::getRootDir()" method is deprecated since Symfony 4.2, use getProjectDir() instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Symfony\Component\HttpKernel\Kernel::getRootDir()\" method is deprecated since Symfony 4.2, use getProjectDir() instead. at /ProjectDir/vendor/symfony/http-kernel/Kernel.php:326)"} []
[2019-01-14 13:55:08] php.INFO: User Deprecated: The "SymfonyBundle\FrameworkBundle\Controller\Controller" class is deprecated since Symfony 4.2, use SymfonyBundle\FrameworkBundle\ControllerAbstractController instead. {"exception":"[object] (ErrorException(code: 0): User Deprecated: The \"Symfony\Bundle\FrameworkBundle\Controller\Controller\" class is deprecated since Symfony 4.2, use Symfony\Bundle\FrameworkBundle\Controller\AbstractController instead. at /ProjectDir/vendor/symfony/framework-bundle/Controller/Controller.php:17)"} []
[2019-01-14 13:55:08] php.CRITICAL: strrpos() expects parameter 1 to be string, null given {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): strrpos() expects parameter 1 to be string, null given at /ProjectDir/vendor/sonata-project/admin-bundle/src/Admin/AbstractAdmin.php:645)"} []
[2019-01-14 13:55:08] php.CRITICAL: strrpos() expects parameter 1 to be string, null given {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): strrpos() expects parameter 1 to be string, null given at /ProjectDir/vendor/sonata-project/admin-bundle/src/Admin/AbstractAdmin.php:645)"} []
This problem is still on 3.45.0 so i tried to find that is going on.
The problem is in declaration the admin page without Entity:
admin.translates:
class: App\Application\ContextBundle\Controller\TranslateAdmin
tags:
- {name: sonata.admin, manager_type: orm, group: Translate, label: Pages}
arguments:
- null
- null
- App\Application\ContextBundle\Controller\TranslateAdminCRUD
public: true
(when i really need it without entity, of course). Passing the random entity class to the second argument fixed the problem - but its i a bug.
Proceeding with a fix, but this is weird, because it implies getClass being null… can you tell me when/why this can happen?
Didn't see your comment. Can you explain a bit more why you need to have an admin with no entity?
In fact, it's better not to fix this, the contract clearly says this cannot be null (or int or resource or whatever):
https://github.com/sonata-project/SonataAdminBundle/blob/96099052f2f1e114538f623d0d35ae7c0b6d3383/src/Admin/AdminInterface.php#L77
Closing as won't fix, please move to '', should fix your issue.
https://symfony.com/doc/master/bundles/SonataAdminBundle/cookbook/recipe_custom_view.html
B
In fact, it's better not to fix this, the contract clearly says this cannot be
null(orintorresourceor whatever):SonataAdminBundle/src/Admin/AdminInterface.php
Line 77 in 9609905
* @return string
Closing as won't fix, please move to'', should fix your issue.
Please, fix the documentation, i followed it https://symfony.com/doc/master/bundles/SonataAdminBundle/cookbook/recipe_custom_view.html
So we should fix this in our docs?
Register the Admin as a Service
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The difference between creating a normal admin class and this one is
that we do not specify the Entity, we leave it as ``null``.
.. code-block:: yaml
# config/services.yaml
services:
app.admin.custom_view:
class: App\Admin\CustomViewAdmin
arguments:
- ~
- ~
- App\Controller\CustomViewCRUDController
tags:
- { name: sonata.admin, manager_type: orm, group: Demo, label: Custom View }
For more information about service configuration please refer to Step 3
of :doc:`../getting_started/creating_an_admin`
*Sorry, I didn't see the last comment! Will fix it in: #5419 *
Done
I am having second thoughts since this was documented, and even if that article is relatively new, I think we should fix this by supporting null unofficially. Incoming PR.
Most helpful comment
So we should fix this in our docs?
*Sorry, I didn't see the last comment! Will fix it in: #5419 *