Commit 58a6dbb8 authored by alexpott's avatar alexpott

Issue #2525884 by jesperjb, joshi.rohit100, Berdir: Avoid unecessary cache tag...

Issue #2525884 by jesperjb, joshi.rohit100, Berdir: Avoid unecessary cache tag invalidations in ConfigEntityBase and aggregator Item entity
parent fb15cca9
......@@ -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);
}
......
......@@ -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());
}
}
/**
......
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment