Issue #1722882 by aspilicious: Fixed Plugin CacheDecorator caches globally.
parent
544e17693f
commit
8fcd8e6057
|
@ -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 @@ class CacheDecorator implements DiscoveryInterface {
|
||||||
* 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue