diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php index 17d6b44..1d62a54 100644 --- a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php +++ b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityDisplayPluginCollection; +use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\EntityDisplayBase; @@ -170,6 +171,16 @@ public function __construct(array $values, $entity_type) { /** * {@inheritdoc} */ + public function postSave(EntityStorageInterface $storage, $update = TRUE) { + // Reset the render cache for the target entity type. + if (\Drupal::entityManager()->hasHandler($this->targetEntityType, 'view_builder')) { + \Drupal::entityManager()->getViewBuilder($this->targetEntityType)->resetCache(); + } + } + + /** + * {@inheritdoc} + */ public function getRenderer($field_name) { if (isset($this->plugins[$field_name])) { return $this->plugins[$field_name]; diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index 98c242f..85c5155 100644 --- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -187,16 +187,6 @@ public function calculateDependencies() { /** * {@inheritdoc} */ - public function postSave(EntityStorageInterface $storage, $update = TRUE) { - // Reset the render cache for the target entity type. - if (\Drupal::entityManager()->hasHandler($this->targetEntityType, 'view_builder')) { - \Drupal::entityManager()->getViewBuilder($this->targetEntityType)->resetCache(); - } - } - - /** - * {@inheritdoc} - */ public function toArray() { $properties = parent::toArray(); // Do not store options for fields whose display is not set to be