diff --git a/core/modules/block/block.services.yml b/core/modules/block/block.services.yml index 24e5ff1..f059b3d 100644 --- a/core/modules/block/block.services.yml +++ b/core/modules/block/block.services.yml @@ -13,7 +13,7 @@ services: class: Drupal\block\Routing\RouteSubscriber tags: - { name: event_subscriber} - arguments: ['@service_container'] + arguments: ['@plugin.manager.system.plugin_ui'] block.theme_access_check: class: Drupal\block\Access\BlockThemeAccessCheck tags: diff --git a/core/modules/block/lib/Drupal/block/Routing/RouteSubscriber.php b/core/modules/block/lib/Drupal/block/Routing/RouteSubscriber.php index f847c1c..7c6f77e 100644 --- a/core/modules/block/lib/Drupal/block/Routing/RouteSubscriber.php +++ b/core/modules/block/lib/Drupal/block/Routing/RouteSubscriber.php @@ -10,8 +10,8 @@ use Drupal\Core\Routing\RoutingEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Routing\Route; -use Drupal\system\Plugin\Type\PluginUIManager; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Component\Plugin\PluginManagerInterface; /** * Listens to the dynamic route events. @@ -19,19 +19,19 @@ class RouteSubscriber implements EventSubscriberInterface { /** - * The injection container that should be passed into the controller factory. + * The injection plugin manager that should be passed into the route. * - * @var \Symfony\Component\DependencyInjection\ContainerInterface + * @var \Drupal\Component\Plugin\PluginManagerInterface */ - protected $container; + protected $plugin_manager; /** - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container + * @param \Drupal\Component\Plugin\PluginManagerInterface $plugin_manager * The service container this object should use. */ - public function __construct(ContainerInterface $container) { - $this->container = $container; + public function __construct(PluginManagerInterface $plugin_manager) { + $this->plugin_manager = $plugin_manager; } /** * Implements EventSubscriberInterface::getSubscribedEvents(). @@ -52,7 +52,7 @@ static function getSubscribedEvents() { */ public function routes(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); - foreach ($this->container->get('plugin.manager.system.plugin_ui')->getDefinitions() as $plugin_id => $plugin) { + foreach ($this->plugin_manager->getDefinitions() as $plugin_id => $plugin) { list($plugin_base, $key) = explode(':', $plugin_id); if ($plugin_base == 'block_plugin_ui') { $route = new Route('admin/structure/block/list/' . $plugin_id, array(