diff --git a/core/lib/Drupal/Core/Config/CachedStorage.php b/core/lib/Drupal/Core/Config/CachedStorage.php index 7253b54..81b2660 100644 --- a/core/lib/Drupal/Core/Config/CachedStorage.php +++ b/core/lib/Drupal/Core/Config/CachedStorage.php @@ -107,8 +107,8 @@ public function readMultiple(array $names) { } // Add the configuration objects from the cache to the list. - foreach ($cached_list as $name => $cache) { - $list[$name] = $cache->data; + foreach ($cached_list as $cid => $cache) { + $list[$this->getNameFromCacheKey($cid)] = $cache->data; } // Ensure that only existing configuration objects are returned, filter out @@ -276,6 +276,19 @@ protected function getCacheKeys(array $names) { } /** + * Returns the config name from a cache key. + * + * @param string $cid + * Cache key + * + * @return string + * Name of the config file. + */ + protected function getNameFromCacheKey($cid) { + return $this->cachePrefix ? substr($cid, strlen($this->cachePrefix) + 1) : $cid; + } + + /** * Set the cache prefix used by this storage. * * @param string $cachePrefix