summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2013-10-01 13:23:15 (GMT)
committerNathaniel Catchpole2013-10-01 13:23:39 (GMT)
commit9ced9d5a3a4e0d2881d9077b70bb381897728790 (patch)
treedc28853d2163b0b1fbed5bc7bc12291f052bb724
parent714f9e3e1b45c2fde1eaf33ed652ba6126607a97 (diff)
Issue #2047997 by jlindsey15, swentel: Get rid of field_behaviors_widget().
-rw-r--r--core/modules/field/field.info.inc23
-rw-r--r--core/modules/field/lib/Drupal/field/FieldInfo.php5
2 files changed, 0 insertions, 28 deletions
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 e6411c3..4113239 100644
--- a/core/modules/field/lib/Drupal/field/FieldInfo.php
+++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
@@ -588,11 +588,6 @@ class FieldInfo {
// 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;
}