diff --git a/core/core.services.yml b/core/core.services.yml index bb8e4bc..21ca95b 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -411,6 +411,11 @@ services: tags: - { name: paramconverter } arguments: ['@entity.manager'] + paramconverter.configentity_admin: + class: Drupal\Core\ParamConverter\AdminPathConfigEntityConverter + tags: + - { name: paramconverter, priority: 5 } + arguments: ['@entity.manager', '@config.factory', '@router.admin_context'] route_subscriber.module: class: Drupal\Core\EventSubscriber\ModuleRouteSubscriber tags: diff --git a/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php index b89e9ff..eba4003 100644 --- a/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php @@ -49,7 +49,8 @@ public function onRoutingRouteAlterSetParameterConverters(RouteBuildEvent $event * {@inheritdoc} */ static function getSubscribedEvents() { - $events[RoutingEvents::ALTER][] = array('onRoutingRouteAlterSetParameterConverters', -200); + // Run after \Drupal\system\EventSubscriber\AdminRouteSubscriber. + $events[RoutingEvents::ALTER][] = array('onRoutingRouteAlterSetParameterConverters', -210); return $events; } } diff --git a/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php b/core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php similarity index 83% rename from core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php rename to core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php index 4dacd6a..7213f16 100644 --- a/core/modules/locale/lib/Drupal/locale/ParamConverter/LocaleAdminPathConfigEntityConverter.php +++ b/core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php @@ -2,25 +2,22 @@ /** * @file - * Contains \Drupal\locale\ParamConverter\LocaleAdminPathConfigEntityConverter. + * Contains \Drupal\Core\ParamConverter\AdminPathConfigEntityConverter. */ -namespace Drupal\locale\ParamConverter; +namespace Drupal\Core\ParamConverter; use Drupal\Core\Routing\AdminContext; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\ParamConverter\EntityConverter; -use Drupal\Core\ParamConverter\ParamConverterInterface; /** - * Makes sure the untranslated ConfigEntity is loaded on admin pages. + * Makes sure the unmodified ConfigEntity is loaded on admin pages. * - * Converts entity route arguments to untranslated entities (in their original - * submission language) as opposed to converting to entities with overrides in - * the negotiated language. + * Converts entity route arguments to unmodified entities as opposed to + * converting to entities with overrides, such as the negotiated language. * * This converter applies only if the path is an admin path. * @@ -29,7 +26,7 @@ * from EntityConverter. As we only allow a single converter per route * argument, EntityConverter is ignored when this converter applies. */ -class LocaleAdminPathConfigEntityConverter extends EntityConverter { +class AdminPathConfigEntityConverter extends EntityConverter { /** * The config factory. diff --git a/core/modules/locale/locale.services.yml b/core/modules/locale/locale.services.yml index 559a066..af97659 100644 --- a/core/modules/locale/locale.services.yml +++ b/core/modules/locale/locale.services.yml @@ -1,9 +1,4 @@ services: - paramconverter.configentity_admin: - class: Drupal\locale\ParamConverter\LocaleAdminPathConfigEntityConverter - tags: - - { name: paramconverter, priority: 5 } - arguments: ['@entity.manager', '@config.factory', '@router.admin_context'] locale.config.typed: class: Drupal\locale\LocaleConfigManager arguments: ['@config.storage', '@config.storage.schema', '@config.storage.installer', '@locale.storage', '@cache.config', '@config.factory', '@language_manager']