diff --git a/core/config/schema/core.entity.schema.yml b/core/config/schema/core.entity.schema.yml index 55eb6f3..bf0e12d 100644 --- a/core/config/schema/core.entity.schema.yml +++ b/core/config/schema/core.entity.schema.yml @@ -109,9 +109,6 @@ core.entity_form_display.*.*.*: type: mapping label: 'Field widget' mapping: - label: - type: string - label: 'Label' type: type: string label: 'Widget type machine name' diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php index 72715a4..1611a05 100644 --- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php +++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php @@ -354,11 +354,14 @@ public function setComponent($name, array $options = array()) { // Ensure we always have an empty settings and array. // @TODO, is this the right place to ensure label is set? - $options += ['label' => '', 'settings' => [], 'third_party_settings' => []]; + $options += ['settings' => [], 'third_party_settings' => []]; $this->content[$name] = $options; + + // Unset these to ensure new settings are picked up. unset($this->hidden[$name]); unset($this->renderers[$name]); + unset($this->plugins[$name]); return $this; } diff --git a/core/lib/Drupal/Core/Field/FormatterPluginManager.php b/core/lib/Drupal/Core/Field/FormatterPluginManager.php index ca9bd06..42c9c03 100644 --- a/core/lib/Drupal/Core/Field/FormatterPluginManager.php +++ b/core/lib/Drupal/Core/Field/FormatterPluginManager.php @@ -56,6 +56,11 @@ public function createInstance($plugin_id, array $configuration = array()) { $plugin_definition = $this->getDefinition($plugin_id); $plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition); + // @TODO, is this missing somewhere else? + if (empty($configuration['label'])) { + $configuration['label'] = ''; + } + // @todo This is copied from \Drupal\Core\Plugin\Factory\ContainerFactory. // Find a way to restore sanity to // \Drupal\Core\Field\FormatterBase::__construct(). diff --git a/core/modules/views/src/Entity/Render/EntityFieldRenderer.php b/core/modules/views/src/Entity/Render/EntityFieldRenderer.php index 353f335..1b05c1b 100644 --- a/core/modules/views/src/Entity/Render/EntityFieldRenderer.php +++ b/core/modules/views/src/Entity/Render/EntityFieldRenderer.php @@ -232,7 +232,6 @@ protected function buildFields(array $values) { $display->setComponent($field->definition['field_name'], [ 'type' => $field->options['type'], 'settings' => $field->options['settings'], - 'label' => $field->label(), ]); } // Let the display build the render array for the entities.