You are here

protected function PanopolySearchRouteSubscriber::alterRoutes in Panopoly 8.2

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

modules/panopoly/panopoly_search/src/Routing/PanopolySearchRouteSubscriber.php, line 26

Class

PanopolySearchRouteSubscriber
Removes module dependency from /admin/reports/search.

Namespace

Drupal\panopoly_search\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // Since panopoly_search is enabled, we want dblog.search to work, so
  // remove the existing module dependency.
  if ($route = $collection
    ->get('dblog.search')) {
    $requirements = $route
      ->getRequirements();
    unset($requirements['_module_dependencies']);
    $route
      ->setRequirements($requirements);
  }
}