diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index 8f912ec023b86075dba88c79714cea547853a45d..5fcac94117958c7aa73384792266412fd8419e49 100644 --- a/core/lib/Drupal/Core/Form/FormBuilder.php +++ b/core/lib/Drupal/Core/Form/FormBuilder.php @@ -1232,10 +1232,7 @@ protected function handleInputElement($form_id, &$element, FormStateInterface &$ // Set the element's #value property. if (!isset($element['#value']) && !array_key_exists('#value', $element)) { - // @todo Once all elements are converted to plugins in - // https://www.drupal.org/node/2311393, rely on - // $element['#value_callback'] directly. - $value_callable = !empty($element['#value_callback']) ? $element['#value_callback'] : 'form_type_' . $element['#type'] . '_value'; + $value_callable = $element['#value_callback'] ?? NULL; if (!is_callable($value_callable)) { $value_callable = '\Drupal\Core\Render\Element\FormElement::valueCallback'; } diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php index fffb59901c4d021a5037a5eb4274f0102dbc4c7a..8ac7339b09fcdf208cc0756db4ec3a510e56b305 100644 --- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php +++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php @@ -257,8 +257,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state); * customize what happens. For example, during this function's life cycle, * the following functions get called for each element: * - $element['#value_callback']: A callable that implements how user input is - * mapped to an element's #value property. This defaults to a function named - * 'form_type_TYPE_value' where TYPE is $element['#type']. + * mapped to an element's #value property. * - $element['#process']: An array of functions called after user input has * been mapped to the element's #value property. These functions can be used * to dynamically add child elements: for example, for the 'date' element