diff --git a/core/lib/Drupal/Core/Field/FormatterBase.php b/core/lib/Drupal/Core/Field/FormatterBase.php index f080cee..a6c8cc8 100644 --- a/core/lib/Drupal/Core/Field/FormatterBase.php +++ b/core/lib/Drupal/Core/Field/FormatterBase.php @@ -79,7 +79,8 @@ public function __construct($plugin_id, $plugin_definition, FieldDefinitionInter public function view(FieldItemListInterface $items) { $elements = $this->viewElements($items); - // If there are actual renderable children, use #theme => field. + // If there are actual renderable children, use #theme => field, otherwise, + // let access cacheability metadata pass through for correct bubbling. if (Element::children($elements)) { $entity = $items->getEntity(); $entity_type = $entity->getEntityTypeId();