From bddf97821e5a8edfa459f795229c097ac9b4d425 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole Date: Fri, 16 Aug 2013 15:22:05 +0100 Subject: [PATCH] Issue #2065149 by damiankloip: Fixed Cache local action plugin definitions. --- core/core.services.yml | 2 +- core/lib/Drupal/Core/Menu/LocalActionManager.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/core.services.yml b/core/core.services.yml index f070b69ed7c..d887663b57d 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -171,7 +171,7 @@ services: arguments: ['@container.namespaces'] plugin.manager.menu.local_action: class: Drupal\Core\Menu\LocalActionManager - arguments: ['@container.namespaces', '@controller_resolver', '@request', '@module_handler'] + arguments: ['@container.namespaces', '@controller_resolver', '@request', '@module_handler', '@cache.cache', '@language_manager'] plugin.manager.menu.local_task: class: Drupal\Core\Menu\LocalTaskManager arguments: ['@container.namespaces', '@controller_resolver', '@request', '@router.route_provider', '@module_handler'] diff --git a/core/lib/Drupal/Core/Menu/LocalActionManager.php b/core/lib/Drupal/Core/Menu/LocalActionManager.php index f4aab248fd3..c99dd830b21 100644 --- a/core/lib/Drupal/Core/Menu/LocalActionManager.php +++ b/core/lib/Drupal/Core/Menu/LocalActionManager.php @@ -7,7 +7,9 @@ namespace Drupal\Core\Menu; +use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Language\LanguageManager; use Drupal\Core\Menu\LocalActionInterface; use Drupal\Core\Plugin\DefaultPluginManager; use Symfony\Component\HttpFoundation\Request; @@ -57,13 +59,18 @@ class LocalActionManager extends DefaultPluginManager { * instances. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. + * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend + * Cache backend instance to use. + * @param \Drupal\Core\Language\LanguageManager $language_manager + * The language manager. */ - public function __construct(\Traversable $namespaces, ControllerResolverInterface $controller_resolver, Request $request, ModuleHandlerInterface $module_handler) { + public function __construct(\Traversable $namespaces, ControllerResolverInterface $controller_resolver, Request $request, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManager $language_manager) { parent::__construct('Plugin/Menu/LocalAction', $namespaces, array(), 'Drupal\Core\Annotation\Menu\LocalAction'); $this->controllerResolver = $controller_resolver; $this->request = $request; $this->alterInfo($module_handler, 'menu_local_actions'); + $this->setCacheBackend($cache_backend, $language_manager, 'local_action_plugins'); } /**