diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php index 3f51143..486543f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php @@ -94,7 +94,8 @@ public function summaryTitle() { * @param $type * The cache type, either 'query', 'result' or 'output'. */ - protected function cacheExpire($type) { } + protected function cacheExpire($type) { + } /** * Determine expiration time in the cache table of the cache type @@ -333,16 +334,17 @@ public function generateOutputKey() { */ protected function getCacheTags() { $tags = array(); + $entity_information = $this->view->query->getEntityInformation(); if (!empty($entity_information)) { $tags[$this->view->storage->id()] = TRUE; - // Add an ENTIY_TYPE_view tag for each entity type used by this view. + // Add an ENTITY_TYPE_view tag for each entity type used by this view. foreach (array_keys($entity_information) as $type) { $tags[$type . '_view'] = TRUE; } - // Collect entity IDs too if there are view results. + // Collect entity IDs if there are view results. if (!empty($this->view->result)) { foreach ($this->view->result as $result) { $type = $result->_entity->entityType(); @@ -360,7 +362,10 @@ protected function getCacheTags() { } } - return $tags; + // Filter out any duplicate values from generated tags. + return array_map(function($item) { + return is_array($item) ? array_unique($item) : $item; + }, $tags); } }