Change record status: 
Project: 
Introduced in branch: 
8.6.x
Introduced in version: 
8.6.0
Description: 

All form elements in Drupal have a "value callback", which is a function that transforms raw user input to the form into a canonical, processed value.

Previously, elements which did not explicitly specify a value callback would have one automatically determined by the form system. For example, a 'textfield' element would be assumed to use a procedural function called form_type_textfield_value() as its value callback, unless another one was specified.

In Drupal 8, all form elements extend \Drupal\Core\Render\Element\FormElement, which defines a default value callback (called, appropriately enough, valueCallback()). Additionally, all form elements in core override this method with their own value callback logic. Therefore, the form system no longer needs to determine a default value callback function, since all form elements have a default value callback anyway.

In Drupal 8.6.0, this whole concept of default value callback functions is deprecated. If your code defines a new form element type, you should implement the valueCallback() method on your element's class explicitly, rather than relying on the form API calling a form_type_YOUR_ELEMENT_TYPE_value() function.

Before

use Drupal\Core\Render\Element\FormElement;

/**
 * @FormElement("magic_bean")
 */
class MagicBean extends FormElement {}

Such an element could be accompanied by a function like:

use Drupal\Core\Form\FormStateInterface;

function form_type_magic_bean_value(array $element, $input = FALSE, FormStateInterface $form_state) {
  return 'magic bean value';
}

After

The above code will still work, but will trigger a deprecation notice. You should implement valueCallback() on the MagicBean class instead:

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\FormElement;

/**
 * @FormElement("magic_bean")
 */
class MagicBean extends FormElement {

  public static function valueCallback(array $element, $input = FALSE, FormStateInterface $form_state) {
    return 'magic bean value';
  }

}
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done
Details: 
Progress: