Only try to rebuild the router table if the dumper is actually available.
parent
684f00dcc1
commit
dca406aa64
|
@ -4,6 +4,7 @@ use Drupal\Component\Utility\NestedArray;
|
||||||
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,14 +6847,16 @@ 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);
|
||||||
|
|
||||||
|
if ($dumper) {
|
||||||
foreach (module_implements('route_info') as $module) {
|
foreach (module_implements('route_info') as $module) {
|
||||||
$routes = call_user_func($module . '_route_info');
|
$routes = call_user_func($module . '_route_info');
|
||||||
drupal_alter('router_info', $routes);
|
drupal_alter('router_info', $routes);
|
||||||
$dumper->addRoutes($routes);
|
$dumper->addRoutes($routes);
|
||||||
$dumper->dump(array('route_set' => $module));
|
$dumper->dump(array('route_set' => $module));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue