Skip to content
Snippets Groups Projects
Commit 8fcd8e60 authored by catch's avatar catch
Browse files

Issue #1722882 by aspilicious: Fixed Plugin CacheDecorator caches globally.

parent 544e1769
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -54,7 +54,7 @@ class CacheDecorator implements DiscoveryInterface { ...@@ -54,7 +54,7 @@ class CacheDecorator implements DiscoveryInterface {
* @param string $cache_bin * @param string $cache_bin
* The cache bin used for storage and retrieval of the definition list. * The cache bin used for storage and retrieval of the definition list.
*/ */
public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bin = 'default') { public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bin = 'cache') {
$this->decorated = $decorated; $this->decorated = $decorated;
$this->cacheKey = $cache_key; $this->cacheKey = $cache_key;
$this->cacheBin = $cache_bin; $this->cacheBin = $cache_bin;
...@@ -64,14 +64,8 @@ public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bi ...@@ -64,14 +64,8 @@ public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bi
* Implements Drupal\Component\Plugin\Discovery\DicoveryInterface::getDefinition(). * Implements Drupal\Component\Plugin\Discovery\DicoveryInterface::getDefinition().
*/ */
public function getDefinition($plugin_id) { public function getDefinition($plugin_id) {
$definitions = $this->getCachedDefinitions(); $definitions = $this->getDefinitions();
if (isset($definitions)) { return isset($definitions[$plugin_id]) ? $definitions[$plugin_id] : array();
$definition = isset($definitions[$plugin_id]) ? $definitions[$plugin_id] : NULL;
}
else {
$definition = $this->decorated->getDefinition($plugin_id);
}
return $definition;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment