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

8.0.x
Larry Garfield 2012-08-11 23:45:08 -05:00 committed by effulgentsia
parent 684f00dcc1
commit dca406aa64
1 changed files with 9 additions and 6 deletions

View File

@ -4,6 +4,7 @@ use Drupal\Component\Utility\NestedArray;
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));
}
}
}
/**