diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index ea2c22c41d686ed748967c86d5bbbf702ac0474f..db0841221a24989ff0c874e32258ee198614449b 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -192,8 +192,6 @@ public function enable() { * {@inheritdoc} */ public function disable() { - // An entity was disabled, invalidate its own cache tag. - Cache::invalidateTags($this->getCacheTagsToInvalidate()); return $this->setStatus(FALSE); } diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index 725f6478be6d2b25e411946421547c8987d6aa51..92c3b7963a9cdbe50f98814ce5bd8a8795f4956c 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -225,7 +225,9 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { // handles the regular cases. The Item entity has one special case: a newly // created Item is *also* associated with a Feed, so we must invalidate the // associated Feed's cache tag. - Cache::invalidateTags($this->getCacheTagsToInvalidate()); + if (!$update) { + Cache::invalidateTags($this->getCacheTagsToInvalidate()); + } } /** diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index ba9171074b24c6e404c25d09d48869ec768c1f7d..fa1c006a264257225da2de16bd79b836bd8ec372 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -376,10 +376,6 @@ public function testEnable() { * @depends testSetStatus */ public function testDisable() { - $this->cacheTagsInvalidator->expects($this->once()) - ->method('invalidateTags') - ->with(array('config:test_provider.' . $this->entityTypeId . '.' . $this->id)); - $this->entity->setStatus(TRUE); $this->assertSame($this->entity, $this->entity->disable()); $this->assertFalse($this->entity->status());