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 a8abdbd..c26542f 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 @@ -137,7 +137,7 @@ public function cacheSet($type) { } /** - * Prepare the view result before putting it into cache. + * Prepares the view result before putting it into cache. * * @param \Drupal\views\ResultRow[] $result * The result containing loaded entities. @@ -147,6 +147,8 @@ public function cacheSet($type) { */ protected function prepareViewResult(array $result) { $return = array(); + // Clone each row object and remove any loaded entities, to keep the + // original result rows intact. foreach ($result as $key => $row) { $clone = clone $row; unset($clone->_entity, $clone->_relationship_entities);