diff -u b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php --- b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php @@ -332,8 +332,9 @@ // The display only cares about fields that specify display options. // Discard base fields that are not rendered through formatters / widgets. - $this->fieldDefinitions = array_filter($definitions, function ($definition) { - return !empty($definition->getDisplayOptions($this->displayContext)); + $display_context = $this->displayContext; + $this->fieldDefinitions = array_filter($definitions, function ($definition) use ($display_context) { + return !empty($definition->getDisplayOptions($display_context)); }); }