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 @@ -312,16 +312,6 @@ } if (($this->targetEntity instanceof ContentEntityInterface) && $this->targetEntity->hasField($field_name)) { $field_definition = $this->targetEntity->get($field_name)->getFieldDefinition(); - - // @todo Nonconfigurable field types don't currently have default - // formatters or widgets defined, but the formatter and plugin managers - // require that, so until that's resolved, suppress returning field - // definitions for those types. - $field_type = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition->getFieldType()); - if (!$field_type['configurable']) { - $field_definition = NULL; - } - return $field_definition; } } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Field/FormatterPluginManager.php +++ b/core/lib/Drupal/Core/Field/FormatterPluginManager.php @@ -139,18 +139,24 @@ public function getInstance(array $options) { * The display properties with defaults added. */ public function prepareConfiguration($field_type, array $configuration) { - // Fill in defaults for missing properties. - $configuration += array( - 'label' => 'above', - 'settings' => array(), - ); - // If no formatter is specified, use the default formatter. + // If no formatter is specified, use the default formatter if the field type + // provides one. if (!isset($configuration['type'])) { $field_type = $this->fieldTypeManager->getDefinition($field_type); - $configuration['type'] = $field_type['default_formatter']; + if (isset($field_type['default_formatter'])) { + $configuration['type'] = $field_type['default_formatter']; + } + } + + // If the field can be displayed (has a formatter), fill in the defaults + // needed to display it. + if (isset($configuration['type'])) { + $configuration += array( + 'label' => 'above', + 'settings' => array(), + ); + $configuration['settings'] += $this->getDefaultSettings($configuration['type']); } - // Fill in default settings values for the formatter. - $configuration['settings'] += $this->getDefaultSettings($configuration['type']); return $configuration; } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Field/WidgetPluginManager.php +++ b/core/lib/Drupal/Core/Field/WidgetPluginManager.php @@ -140,17 +140,23 @@ public function createInstance($plugin_id, array $configuration = array()) { * The display properties with defaults added. */ public function prepareConfiguration($field_type, array $configuration) { - // Fill in defaults for missing properties. - $configuration += array( - 'settings' => array(), - ); - // If no widget is specified, use the default widget. + // If no widget is specified, use the default widget if the field type + // provides one. if (!isset($configuration['type'])) { $field_type = $this->fieldTypeManager->getDefinition($field_type); - $configuration['type'] = $field_type['default_widget']; + if (isset($field_type['default_widget'])) { + $configuration['type'] = $field_type['default_widget']; + } + } + + // If the field can be edited in a UI (has a widget), fill in the defaults + // needed to display that widget. + if (isset($configuration['type'])) { + $configuration += array( + 'settings' => array(), + ); + $configuration['settings'] += $this->getDefaultSettings($configuration['type']); } - // Fill in default settings values for the widget. - $configuration['settings'] += $this->getDefaultSettings($configuration['type']); return $configuration; }