Drupal version 9.3.9.
Already tried with getValue, getValues, getTitle, label. All values can be retrieved, but for the title field I am not able to. I need that value to use in a callback function.
function my_custom_module_image_field_widget_process($element, DrupalCoreFormFormStateInterface $form_state,$form) { #$element['my_field']['#default_value'] =$form_state->getFormObject()->getEntity()- #>label();this work, but useless in the callback if(!empty($form_state->getValue('title'))){ $title = $form_state->getValue('title'); $element['my_field']['#default_value'] = $title; } return $element; }