When just enabling the bundle in AppKernel without any configuration, an exception occurs:
PHP Notice: Undefined index: bundles in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 57
PHP Stack trace:
1. {main}() web/app.php:0
2. Symfony\\Component\\HttpKernel\\Kernel->handle() web/app.php:29
3. Symfony\\Component\\HttpKernel\\Kernel->boot() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:165
4. Symfony\\Component\\HttpKernel\\Kernel->initializeContainer() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:116
5. Symfony\\Component\\DependencyInjection\\ContainerBuilder->compile() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:484
6. Symfony\\Component\\DependencyInjection\\Compiler\\Compiler->compile() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:565
7. Symfony\\Component\\HttpKernel\\DependencyInjection\\MergeExtensionConfigurationPass->process() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:120
8. Symfony\\Component\\DependencyInjection\\Compiler\\MergeExtensionConfigurationPass->process() vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
9. Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension->load() vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:55
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension::loadBundles() must be of the type array, null given, called in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 57 and defined in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php:60\nStack trace:\n#0 vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php(57): Symfony\\Cmf\\Bundle\\SonataAdminIntegrationBundle\\DependencyInjection\\CmfSonataAdminIntegrationExtension->loadBundles(NULL, Object(Symfony\\Component\\DependencyInjection\\Loader\\XmlFileLoader), Object(Symfony\\Component\\DependencyInjection\\ContainerBuilder))\n#1 vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compil in vendor/symfony-cmf/sonata-admin-integration-bundle/src/DependencyInjection/CmfSonataAdminIntegrationExtension.php on line 60
looks for that we forgot the default ( []) state for cmf_sonata_admin_integration.bundles.
On the other hand, enabling the bundle with no bundles activated makes no sense then, so we should throw a configuration exception then instead of an php notice, what do you think @wouterj ?
When just enabling the bundle in
AppKernel
without any configuration, an exception occurs:looks for that we forgot the default (
[]
) state forcmf_sonata_admin_integration.bundles
.