diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php index ca0f9bd..8304fad 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php @@ -83,7 +83,7 @@ public function set($key, $value) { $this->keyValueStore->set($key, $value); $this->offsetSet($key, $value); // Immediately update the cache. - $this->setData(array('key' => $value)); + $this->setData(array($key => $value)); } } diff --git a/core/lib/Drupal/Core/Utility/CacheArray.php b/core/lib/Drupal/Core/Utility/CacheArray.php index 3e6c914..03deeae 100644 --- a/core/lib/Drupal/Core/Utility/CacheArray.php +++ b/core/lib/Drupal/Core/Utility/CacheArray.php @@ -214,7 +214,7 @@ protected function setData($data, $lock = TRUE) { $lock_name = $this->cid . ':' . $this->bin; if (!$lock || lock()->acquire($lock_name)) { if ($cached = cache($this->bin)->get($this->cid)) { - $data = $cached->data + $data; + $data = array_merge($cached->data, $data); } // Remove keys marked for deletion. foreach ($this->keysToRemove as $delete_key) {