diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php b/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php index 6f24a68..077fe1f 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Routing/RouteSubscriber.php @@ -67,8 +67,8 @@ protected function alterRoutes(RouteCollection $collection, $provider) { unset($this->baseRouteNames[$mapper_id]); } } - if (!empty($this->baseRouteNames)) { - throw new \Exception('Well, if @dawehner has NFI, what is @tstoeckler supposed to say?!'); + if ($provider == 'dynamic_routes' && !empty($this->baseRouteNames)) { + throw new \RuntimeException(sprintf('The following routes are needed by configuration mappers but were not found: %s', implode(', ', $this->baseRouteNames))); } } @@ -79,7 +79,10 @@ public static function getSubscribedEvents() { $events = parent::getSubscribedEvents(); // This route subscriber adds routes based on the existence of other routes, // so all route subscribers that add routes need to run before this one. - $events[RoutingEvents::ALTER] = array('onAlterRoutes', -10); + // Field UI's route subscriber, for example, has priority -100, but provides + // routes for which we need to generate translation routes so this priority + // needs to be lower than that. + $events[RoutingEvents::ALTER] = array('onAlterRoutes', -1000); return $events; }