diff --git a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php index 2d9ba76..92bee80 100644 --- a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php @@ -8,6 +8,7 @@ namespace Drupal\Core\EventSubscriber; use Drupal\Component\Utility\String; +use Drupal\Core\Routing\RouteBuildEvent; use Drupal\Core\Routing\RouteSubscriberBase; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\Routing\RouteCollection; @@ -45,4 +46,12 @@ protected function alterRoutes(RouteCollection $collection, $module) { return TRUE; } + /** + * {@inheritdoc} + */ + public function onAlterRoutes(RouteBuildEvent $event) { + $collection = $event->getRouteCollection(); + return $this->alterRoutes($collection, $event->getModule()); + } + } diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php index 7555768..f003327 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php @@ -84,7 +84,7 @@ public function providerTestOnRouteBuildingValidVariables() { } /** - * Tests the onRouteBuilding method for valid variables. + * Tests the onAlterRoutes method for valid variables. * * @param \Symfony\Component\Routing\Route $route * The route to check. @@ -95,11 +95,11 @@ public function testOnRouteBuildingValidVariables(Route $route) { $route_collection = new RouteCollection(); $route_collection->add('test', $route); $event = new RouteBuildEvent($route_collection, 'test'); - $this->assertTrue($this->specialAttributesRouteSubscriber->onRouteBuilding($event)); + $this->assertTrue($this->specialAttributesRouteSubscriber->onAlterRoutes($event)); } /** - * Tests the onRouteBuilding method for invalid variables. + * Tests the onAlterRoutes method for invalid variables. * * @param \Symfony\Component\Routing\Route $route * The route to check. @@ -110,7 +110,7 @@ public function testOnRouteBuildingInvalidVariables(Route $route) { $route_collection = new RouteCollection(); $route_collection->add('test', $route); $event = new RouteBuildEvent($route_collection, 'test'); - $this->assertFalse($this->specialAttributesRouteSubscriber->onRouteBuilding($event)); + $this->assertFalse($this->specialAttributesRouteSubscriber->onAlterRoutes($event)); } }