By narendrar on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.2.x
Introduced in version:
11.2.0
Issue links:
Description:
Important:
Ensure your code is using hook_field_info_entity_type_ui_definitions_alter when possible. Refer to this change record for an example.
For code directly altering the field storage form:
\Drupal\field_ui\Form\FieldStorageAddForm is now split into \Drupal\field_ui\Form\FieldStorageAddForm and a new controller \Drupal\field_ui\Form\FieldStorageAddController. Field creation/editing process open in modals (field selection form, combined field settings form).
This means that form alter implementations may need to be updated.
Before
#[Hook('form_field_ui_field_storage_add_form_alter')]
public function formFieldUiFieldStorageAddFormAlter(&$form, FormStateInterface $form_state, $form_id) : void {
$storage_type = $form_state->getValue('new_storage_type');
if ($storage_type === 'field_my_type')) {
$form['group_field_options_wrapper']['description_wrapper'] = ['#type' => 'item', '#markup' => t('My description')];
}
}
After
#[Hook('form_field_ui_field_storage_add_form_alter')]
public function formFieldUiFieldStorageAddFormAlter(&$form, FormStateInterface $form_state, $form_id) : void {
$storage_type = $form_state->getStorage()['field_type'];
if ($storage_type === 'field_my_type') {
$form['field_options_wrapper']['description_wrapper'] = ['#type' => 'item', '#markup' => t('My description')];
}
}
Impacts:
Site builders, administrators, editors
Module developers
Themers
Site templates, recipes and distribution developers