- 🇺🇸United States smustgrave
I think it would be nice to have a deprecation just in case someone has custom code. Better safe then sorry
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
I don't think we need to do a deprecation dance here - see http://grep.xnddx.ru/search?text=function+form_type_&filename= all the calls here would be broken due to the core functions no longer existing.
We do need to update the document in \Drupal\Core\Form\FormBuilderInterface::doBuildForm() though as this says:
* - $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'].
- Status changed to Needs review
about 1 year ago 6:07pm 17 October 2023 - last update
about 1 year ago 29,672 pass - 🇺🇸United States fathershawn New York
Thanks @larowan. I fixed this in the course of working on #value_callback and did it just as you did in your patch. My only difference is the stated default. The logic of the code sets the default to
\Drupal\Core\Render\Element\FormElement::valueCallback
. I'll leave a comment on the other issue and perhaps we can close them together? - Status changed to RTBC
about 1 year ago 7:03pm 18 October 2023 - 🇺🇸United States smustgrave
Talking in slack wtih @FatherShawn and the two tickets do overlap but think we agreed this could probably land first (or has a better shot of it) while the larger task of 📌 Limit what can be called by a callback in form arrays Needs work is worked on.
- Status changed to Needs work
about 1 year ago 12:33pm 19 October 2023 - 🇬🇧United Kingdom longwave UK
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php @@ -257,8 +257,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state); * - $element['#value_callback']: A callable that implements how user input is + * mapped to an element's #value property. This defaults to a function is NULL.
Not sure what this sentence is trying to say. I think we can just say something like:
* - $element['#value_callback']: A optional callable that implements how user * input is mapped to an element's #value property.
- Status changed to RTBC
about 1 year ago 12:40pm 19 October 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Discussed with @longwave and the change from form_type_* functions to valueCallback is part of https://www.drupal.org/node/2320115 → - a very old CR indeed!
Going fix the comment on commit (after discussing with @longwave).
- Status changed to Fixed
about 1 year ago 12:47pm 19 October 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Committed and pushed 5cbb5c9f46f to 11.x and 884929d80ba to 10.2.x. Thanks!
-
alexpott →
committed 382e811b on 10.2.x
Issue #3221798 by larowlan, pradhumanjain2311, alexpott, tim.plunkett,...
-
alexpott →
committed 382e811b on 10.2.x
-
alexpott →
committed 016718a8 on 11.x
Issue #3221798 by larowlan, pradhumanjain2311, alexpott, tim.plunkett,...
-
alexpott →
committed 016718a8 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.