Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 4506b9c

Browse files
committed
Fix loading resources from main config file
$config['mapping'] doesn't have a default value. You can read resources only if mapping section is defined in main config file. If you have auto routing defined per bundle you dont'have it.
1 parent 7042b18 commit 4506b9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

DependencyInjection/CmfRoutingAutoExtension.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ public function load(array $configs, ContainerBuilder $container)
4242
}
4343

4444
// add configured mapping file resources
45-
foreach ($config['mapping']['resources'] as $resource) {
46-
$resources[] = $resource;
45+
if (isset($config['mapping']['resources'])) {
46+
foreach ($config['mapping']['resources'] as $resource) {
47+
$resources[] = $resource;
48+
}
4749
}
4850
$container->setParameter('cmf_routing_auto.metadata.loader.resources', $resources);
4951

0 commit comments

Comments
 (0)