summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-06-30 13:28:00 (GMT)
committerNathaniel Catchpole2014-06-30 13:28:00 (GMT)
commit3d06929d6df22413a17009890595bbc17e95fdf5 (patch)
tree543296f6621912951edca1c0ee136f028cfc0111
parent6a3574acf9143cde8dc2a21b155721892a20d941 (diff)
Issue #2087965 by AndyThornton, neclimdul, tim.plunkett, jhodgdon, pwolanin: Fixed The SearchPluginManager needs to provide an alter hook for its discovery.
-rw-r--r--core/modules/search/search.api.php16
-rw-r--r--core/modules/search/src/SearchPluginManager.php4
2 files changed, 17 insertions, 3 deletions
diff --git a/core/modules/search/search.api.php b/core/modules/search/search.api.php
index 2b6be9a..8deb15c 100644
--- a/core/modules/search/search.api.php
+++ b/core/modules/search/search.api.php
@@ -48,3 +48,19 @@ function hook_search_preprocess($text, $langcode = NULL) {
return $text;
}
+
+/**
+ * Alter search plugin definitions.
+ *
+ * @param array $definitions
+ * The array of search plugin definitions, keyed by plugin ID.
+ *
+ * @see \Drupal\search\Annotation\SearchPlugin
+ * @see \Drupal\search\SearchPluginManager
+ */
+function hook_search_plugin_alter(array &$definitions) {
+ if (isset($definitions['node_search'])) {
+ $definitions['node_search']['title'] = t('Nodes');
+ }
+}
+
diff --git a/core/modules/search/src/SearchPluginManager.php b/core/modules/search/src/SearchPluginManager.php
index a7e2238..5670e71 100644
--- a/core/modules/search/src/SearchPluginManager.php
+++ b/core/modules/search/src/SearchPluginManager.php
@@ -29,9 +29,7 @@ class SearchPluginManager extends DefaultPluginManager {
*/
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/Search', $namespaces, $module_handler, 'Drupal\search\Annotation\SearchPlugin');
-
$this->setCacheBackend($cache_backend, 'search_plugins');
- // @todo Set an alter hook.
+ $this->alterInfo('search_plugin');
}
-
}