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 58623d7..9c7131d 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php +++ b/core/modules/field/lib/Drupal/field/Plugin/DisplayComponent/FieldDisplayComponentHandler.php @@ -24,14 +24,14 @@ class FieldDisplayComponentHandler extends DisplayComponentHandlerBase { * {@inheritdoc} */ public function massageIn($name, array $options = array()) { + $field = Field::fieldInfo()->getField($this->context['entity_type'], $name); if ($this->context['display_context'] == 'display') { // @todo do we need to check the field exists on the bundle ? // Do we need a more general check by the handler that the $name is a valid component ? - $field = Field::fieldInfo()->getField($this->context['entity_type'], $name); return \Drupal::service('plugin.manager.field.formatter')->prepareConfiguration($field->getFieldType(), $options); } else { - return $options; + return \Drupal::service('plugin.manager.field.widget')->prepareConfiguration($field->getFieldType(), $options); } }