diff --git a/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php index 2111f8d..3565e8b 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/CacheDecorator.php @@ -69,7 +69,8 @@ public function getDefinition($plugin_id) { return $this->definitions[$plugin_id]; } - if (($definitions = $this->getDefinitions()) && isset($definitions[$plugin_id])) { + $definitions = $this->getDefinitions(); + if (isset($definitions[$plugin_id])) { return $definitions[$plugin_id]; } } @@ -100,10 +101,9 @@ public function getDefinitions() { * and would actually be returned by the getDefinitions() method. */ protected function getCachedDefinitions() { - if (!isset($this->definitions) && isset($this->cacheKey) && $cache = cache($this->cacheBin)->get($this->cacheKey)) { - $this->definitions = $cache->data; + if (isset($this->cacheKey) && $cache = cache($this->cacheBin)->get($this->cacheKey)) { + return $cache->data; } - return $this->definitions; } /**