diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php index 799c262..0aec9f8 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Routing/ContentTranslationRouteSubscriber.php @@ -51,12 +51,18 @@ public function __construct(ContentTranslationManagerInterface $content_translat */ protected function routes(RouteCollection $collection) { foreach ($this->contentTranslationManager->getSupportedEntityTypes() as $entity_type => $entity_info) { + // First try to get the route from the current collection. + if (!$entity_route = $collection->get($entity_info['links']['canonical'])) { + // Then try to get the route from the route provider itself, checking + // all previous collections. try { $entity_route = $this->routeProvider->getRouteByName($entity_info['links']['canonical']); } + // If the route was not found, skip this entity type. catch (RouteNotFoundException $e) { continue; } + } $path = $entity_route->getPath() . '/translations'; $route = new Route(