diff --git a/core/modules/entity/lib/Drupal/entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler.php b/core/modules/entity/lib/Drupal/entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler.php index ce9a51e..157ed46 100644 --- a/core/modules/entity/lib/Drupal/entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler.php +++ b/core/modules/entity/lib/Drupal/entity/Plugin/DisplayComponent/ExtraFieldDisplayComponentHandler.php @@ -100,7 +100,8 @@ public function onComponentGet($name, array $options = array()) { */ public function onComponentSet($name, array $options = array()) { // All 'Extra fields' are visible by default. - return array('visible' => TRUE); + $options['visible'] = TRUE; + return $options; } /** diff --git a/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php b/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php index 99f6178..f40bfdb 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php +++ b/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php @@ -85,6 +85,11 @@ public static function create(ContainerInterface $container, array $configuratio */ public function onComponentSet($name, array $options = array()) { $field = $this->fieldInfo->getField($this->context['entity_type'], $name); + if (!$field) { + // The field in process of removal or something goes weird. + // @todo check code that leads to this case. + return parent::onComponentSet($name, $options); + } // Prepare configuration on render plugin to not prepare on render. if ($this->context['display_context'] == 'display') { return $this->formatterPluginManager->prepareConfiguration($field->getFieldType(), $options);