Commit 709e3044 authored by catch's avatar catch

Issue #2090947 by Bladedu: Fixed SearchPluginManager plugin definitions aren't cached.

parent 5b3ff0d5
......@@ -11,6 +11,8 @@
use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Plugin\DefaultPluginManager;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Language\LanguageManager;
/**
* SearchExecute plugin manager.
......@@ -27,10 +29,11 @@ class SearchPluginManager extends DefaultPluginManager {
/**
* {@inheritdoc}
*/
public function __construct(\Traversable $namespaces, ConfigFactory $config_factory) {
public function __construct(\Traversable $namespaces, ConfigFactory $config_factory, CacheBackendInterface $cache_backend, LanguageManager $language_manager) {
parent::__construct('Plugin/Search', $namespaces, 'Drupal\search\Annotation\SearchPlugin');
$this->configFactory = $config_factory;
$this->setCacheBackend($cache_backend, $language_manager, 'search_plugins');
}
/**
......
services:
plugin.manager.search:
class: Drupal\search\SearchPluginManager
arguments: ['@container.namespaces', '@config.factory']
arguments: ['@container.namespaces', '@config.factory', '@cache.cache', '@language_manager']
access_check.search:
class: Drupal\search\Access\SearchAccessCheck
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment