diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php index bc4efa0..c909239 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php @@ -92,7 +92,7 @@ public function loadUnchanged($id) { * {@inheritdoc} */ public function resetCache(array $ids = NULL) { - if (isset($ids)) { + if ($this->cache && isset($ids)) { foreach ($ids as $id) { unset($this->entityCache[$id]); } @@ -114,7 +114,7 @@ public function resetCache(array $ids = NULL) { protected function cacheGet($ids) { $entities = array(); // Load any available entities from the internal cache. - if (!empty($this->entityCache)) { + if ($this->cache && !empty($this->entityCache)) { $entities += array_intersect_key($this->entityCache, array_flip($ids)); } return $entities; @@ -127,7 +127,9 @@ protected function cacheGet($ids) { * Entities to store in the cache. */ protected function cacheSet($entities) { - $this->entityCache += $entities; + if ($this->cache) { + $this->entityCache += $entities; + } } }