diff --git a/core/lib/Drupal/Core/Cache/BackendChain.php b/core/lib/Drupal/Core/Cache/BackendChain.php index 548d62d..16136df 100644 --- a/core/lib/Drupal/Core/Cache/BackendChain.php +++ b/core/lib/Drupal/Core/Cache/BackendChain.php @@ -130,6 +130,15 @@ public function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANEN } /** + * Implements Drupal\Core\Cache\CacheBackendInterface::setMultiple(). + */ + public function setMultiple(array $items) { + foreach ($this->backends as $backend) { + $backend->setMultiple($items); + } + } + + /** * Implements Drupal\Core\Cache\CacheBackendInterface::delete(). */ public function delete($cid) { diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index 857e802..98c47db 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -154,16 +154,19 @@ public function set($cid, $data, $expire = CacheBackendInterface::CACHE_PERMANEN function setMultiple(array $items) { try { $this->deleteMultiple(array_keys($items)); - $query = Database::getConnection()->insert($this->bin)->fields(array('cid', 'data', 'expire', 'created', 'serialized', 'tags', 'checksum')); + $query = Database::getConnection()->insert($this->bin)->fields(array('cid', 'data', 'expire', 'created', 'serialized', 'tags', 'checksum_invalidations', 'checksum_deletions')); foreach ($items as $cid => $item) { + $flat_tags = $this->flattenTags(isset($item['tags']) ? $item['tags'] : array()); + $checksum = $this->checksumTags($flat_tags); $fields = array( 'cid' => $cid, 'data' => is_string($item['data']) ? $item['data'] : serialize($item['data']), 'expire' => isset($item['expire']) ? $item['expire'] : CacheBackendInterface::CACHE_PERMANENT, 'created' => REQUEST_TIME, 'serialized' => is_string($item['data']) ? 0 : 1, - 'tags' => isset($item['tags']) ? implode(' ', $this->flattenTags($item['tags'])) : '', - 'checksum' => $this->checksumTags(isset($item['tags']) ? $item['tags'] : array()), + 'tags' => implode(' ', $flat_tags), + 'checksum_invalidations' => $checksum['invalidations'], + 'checksum_deletions' => $checksum['deletions'], ); $query->values($fields); } diff --git a/core/modules/views/lib/Drupal/views/ViewsDataCache.php b/core/modules/views/lib/Drupal/views/ViewsDataCache.php index 091bc7b..f7eacca 100644 --- a/core/modules/views/lib/Drupal/views/ViewsDataCache.php +++ b/core/modules/views/lib/Drupal/views/ViewsDataCache.php @@ -229,7 +229,7 @@ public function __destruct() { try { if ($this->rebuildCache && !empty($this->storage) && !$this->skipCache) { // Keep a record with all data. - $items = array($this->baseCid . ':' . $this->langcode => $this->storage); + $items = array($this->baseCid . ':' . $this->langcode => array('data' => $this->storage)); // Save data in seperate cache entries. foreach ($this->storage as $table => $data) { $cid = $this->baseCid . ':' . $table . ':' . $this->langcode;