core/lib/Drupal/Core/Field/FormatterBase.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Core/Field/FormatterBase.php b/core/lib/Drupal/Core/Field/FormatterBase.php index eb43e6d..45e3200 100644 --- a/core/lib/Drupal/Core/Field/FormatterBase.php +++ b/core/lib/Drupal/Core/Field/FormatterBase.php @@ -103,9 +103,8 @@ public function view(FieldItemListInterface $items) { if (isset($item->entity)) { $info['#cache']['tags'] = NestedArray::mergeDeep($info['#cache']['tags'], $item->entity->getCacheTag()); if ($item->entity->getEntityType()->hasControllerClass('view_builder')) { - $view_cache_tag = $item->entity - ->getEntityType() - ->getControllerClass('view_builder') + $view_cache_tag = \Drupal::entityManager() + ->getViewBuilder($item->entity->getEntityTypeId()) ->getCacheTag(); $info['#cache']['tags'] = NestedArray::mergeDeep($info['#cache']['tags'], $view_cache_tag); }