diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc index 79345a8..3c6bfde 100644 --- a/core/modules/field/field.info.inc +++ b/core/modules/field/field.info.inc @@ -45,29 +45,6 @@ function field_info_cache_clear() { } /** - * 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. * * Use of this function should be avoided when possible, since it loads and diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php index 8d6bc3a..ed1c7b1 100644 --- a/core/modules/field/lib/Drupal/field/FieldInfo.php +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php @@ -592,7 +592,7 @@ public function prepareInstance($instance, $field_type) { $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'])) { + if (!isset($instance['default_value'])) { $instance['default_value'] = NULL; }