Commit 8fcd8e60 authored by catch's avatar catch

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

parent 544e1769
......@@ -54,7 +54,7 @@ class CacheDecorator implements DiscoveryInterface {
* @param string $cache_bin
* 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->cacheKey = $cache_key;
$this->cacheBin = $cache_bin;
......@@ -64,14 +64,8 @@ public function __construct(DiscoveryInterface $decorated, $cache_key, $cache_bi
* Implements Drupal\Component\Plugin\Discovery\DicoveryInterface::getDefinition().
*/
public function getDefinition($plugin_id) {
$definitions = $this->getCachedDefinitions();
if (isset($definitions)) {
$definition = isset($definitions[$plugin_id]) ? $definitions[$plugin_id] : NULL;
}
else {
$definition = $this->decorated->getDefinition($plugin_id);
}
return $definition;
$definitions = $this->getDefinitions();
return isset($definitions[$plugin_id]) ? $definitions[$plugin_id] : array();
}
/**
......
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