Skip to content
Snippets Groups Projects

Fixing CE cache dependency

Merged Bálint Junkuncz requested to merge issue/custom_elements-3468371:3468371-old-content-is into 3.x
Files
3
@@ -207,6 +207,21 @@ class EntityCeDisplay extends EntityDisplayBase implements EntityCeDisplayInterf
];
}
/**
* {@inheritdoc}
*/
public function getCacheTagsToInvalidate() {
$tags = parent::getCacheTagsToInvalidate();
// $tags is a single tag, ending in the view mode. When using the default
// display to build a specific view mode, also add a tag for that view mode.
$tag = current($tags);
if ($this->originalMode !== 'default' && substr($tag, -8) === '.default') {
$tags[] = substr($tag, 0, strlen($tag) - 7) . $this->originalMode;
}
return $tags;
}
/**
* {@inheritdoc}
*/
Loading