diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index 79345a84efa34af5ca4ac1f165738a15fcd4be00..3c6bfde97c5a8221c36931912e71785d2a417842 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -44,29 +44,6 @@ function field_info_cache_clear() { Field::fieldInfo()->flush(); } -/** - * Determines the behavior of a widget with respect to an operation. - * - * @param string $op - * The name of the operation. Currently supported: 'default_value', - * 'multiple_values'. - * @param array $instance - * The field instance array. - * - * @return int - * One of these values: - * - FIELD_BEHAVIOR_NONE: Do nothing for this operation. - * - FIELD_BEHAVIOR_CUSTOM: Use the widget's callback function. - * - FIELD_BEHAVIOR_DEFAULT: Use field.module default behavior. - */ -function field_behaviors_widget($op, $instance) { - $info = array(); - if ($component = entity_get_form_display($instance['entity_type'], $instance['bundle'], 'default')->getComponent($instance['field_name'])) { - $info = \Drupal::service('plugin.manager.field.widget')->getDefinition($component['type']); - } - return isset($info[$op]) ? $info[$op] : FIELD_BEHAVIOR_DEFAULT; -} - /** * Returns all field definitions. * diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php index e6411c3807147f48456b877049983b5bf72ace80..4113239020dd4422c91e5df401984ed18f4a2368 100644 --- a/core/modules/field/lib/Drupal/field/FieldInfo.php +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php @@ -588,11 +588,6 @@ public function prepareInstance($instance, $field_type) { // Make sure all expected instance settings are present. $instance['settings'] += $this->fieldTypeManager->getDefaultInstanceSettings($field_type); - // Set a default value for the instance. - if (field_behaviors_widget('default value', $instance) == FIELD_BEHAVIOR_DEFAULT && !isset($instance['default_value'])) { - $instance['default_value'] = NULL; - } - return $instance; }