Commit dca406aa authored by Crell's avatar Crell Committed by effulgentsia

Only try to rebuild the router table if the dumper is actually available.

parent 684f00dc
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Cache\CacheBackendInterface;
use Symfony\Component\DependencyInjection\Container;
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Drupal\Core\Template\Attribute; use Drupal\Core\Template\Attribute;
...@@ -6846,13 +6847,15 @@ function router_rebuild() { ...@@ -6846,13 +6847,15 @@ function router_rebuild() {
// a given item came from. // a given item came from.
$callbacks = array(); $callbacks = array();
$dumper = drupal_container()->get('router.dumper'); $dumper = drupal_container()->get('router.dumper', Container::NULL_ON_INVALID_REFERENCE);
foreach (module_implements('route_info') as $module) { if ($dumper) {
$routes = call_user_func($module . '_route_info'); foreach (module_implements('route_info') as $module) {
drupal_alter('router_info', $routes); $routes = call_user_func($module . '_route_info');
$dumper->addRoutes($routes); drupal_alter('router_info', $routes);
$dumper->dump(array('route_set' => $module)); $dumper->addRoutes($routes);
$dumper->dump(array('route_set' => $module));
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment