diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 5eb5c30..27fc850 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -293,7 +293,14 @@ protected function doPreSave(EntityInterface $entity) { // Sync the changes made in the fields array to the internal values array. $entity->updateOriginalValues(); - return parent::doPreSave($entity); + $return = parent::doPreSave($entity); + + // Reset the persistent cache if this entity type uses it. + if (!$entity->isNew() && $this->entityType->isPersistentlyCacheable()) { + $this->cacheBackend->delete($this->buildCacheId($entity->id())); + } + + return $return; } /** @@ -612,20 +619,12 @@ protected function setPersistentCache($entities) { */ public function resetCache(array $ids = NULL) { if ($ids) { - $cids = array(); foreach ($ids as $id) { unset($this->entities[$id]); - $cids[] = $this->buildCacheId($id); - } - if ($this->entityType->isPersistentlyCacheable()) { - $this->cacheBackend->deleteMultiple($cids); } } else { $this->entities = array(); - if ($this->entityType->isPersistentlyCacheable()) { - Cache::invalidateTags(array($this->entityTypeId . '_values')); - } } }