From 016718a87ff6725cb91c8a347f5b673a93f4f3d0 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 19 Oct 2023 14:46:26 +0200 Subject: [PATCH] Issue #3221798 by larowlan, pradhumanjain2311, alexpott, tim.plunkett, tunic, Eric_A, longwave, FatherShawn: Remove stale processing and reference to form_type_TYPE_value --- core/lib/Drupal/Core/Form/FormBuilder.php | 5 +---- core/lib/Drupal/Core/Form/FormBuilderInterface.php | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php index 8f912ec023b8..5fcac9411795 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 fffb59901c4d..8ac7339b09fc 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 -- GitLab