-
-
Save damiankloip/8218032 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/lib/Drupal/Core/Routing/RouteBuilder.php b/core/lib/Drupal/Core/Routing/RouteBuilder.php | |
index 76a826b..dd894a4 100644 | |
--- a/core/lib/Drupal/Core/Routing/RouteBuilder.php | |
+++ b/core/lib/Drupal/Core/Routing/RouteBuilder.php | |
@@ -119,8 +119,13 @@ public function rebuild() { | |
foreach ($routes['route_callbacks'] as $route_callback) { | |
$callback = $this->controllerResolver->getControllerFromDefinition($route_callback); | |
if ($callback_routes = call_user_func($callback)) { | |
- foreach ($callback_routes as $name => $callback_route) { | |
- $collection->add($name, $callback_route); | |
+ if (is_array($callback_routes)) { | |
+ foreach ($callback_routes as $name => $callback_route) { | |
+ $collection->add($name, $callback_route); | |
+ } | |
+ } | |
+ else { | |
+ $collection->addCollection($callback_routes); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment