Skip to content
Snippets Groups Projects
Commit e2ee398c authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

Ensure that route altering runs after workspaces_ui.

parent 487825a6
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment