diff --git a/modules/entity_workflow_workspace/src/Routing/RouteSubscriber.php b/modules/entity_workflow_workspace/src/Routing/RouteSubscriber.php index a61d5da2aa3c46f124b6317c92cadf26d48cec6f..b0d49427b8d1a4389cae9dd9ec09428b6a3d9e61 100644 --- a/modules/entity_workflow_workspace/src/Routing/RouteSubscriber.php +++ b/modules/entity_workflow_workspace/src/Routing/RouteSubscriber.php @@ -3,6 +3,7 @@ namespace Drupal\entity_workflow_workspace\Routing; use Drupal\Core\Routing\RouteSubscriberBase; +use Drupal\Core\Routing\RoutingEvents; use Symfony\Component\Routing\RouteCollection; /** @@ -16,7 +17,7 @@ class RouteSubscriber extends RouteSubscriberBase { /** * {@inheritdoc} */ - protected function alterRoutes(RouteCollection $collection) { + protected function alterRoutes(RouteCollection $collection): void { // Disallow access the generic 'Publish' and 'Revert' routes, these actions // are done with workflow transitions. if ($route = $collection->get('entity.workspace.publish_form')) { @@ -27,4 +28,14 @@ class RouteSubscriber extends RouteSubscriberBase { } } + /** + * {@inheritdoc} + */ + public static function getSubscribedEvents(): array { + $events = parent::getSubscribedEvents(); + // Run after \Drupal\workspaces_ui\Routing\RouteSubscriber. + $events[RoutingEvents::ALTER] = ['onAlterRoutes', -100]; + return $events; + } + }