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 @@
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Drupal\Core\Cache\CacheBackendInterface;
use Symfony\Component\DependencyInjection\Container;
use Drupal\Core\Database\Database;
use Drupal\Core\Template\Attribute;
......@@ -6846,14 +6847,16 @@ function router_rebuild() {
// a given item came from.
$callbacks = array();
$dumper = drupal_container()->get('router.dumper');
$dumper = drupal_container()->get('router.dumper', Container::NULL_ON_INVALID_REFERENCE);
if ($dumper) {
foreach (module_implements('route_info') as $module) {
$routes = call_user_func($module . '_route_info');
drupal_alter('router_info', $routes);
$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