function field_ui_form_field_config_edit_form_alter

Implements hook_form_FORM_ID_alter() for field_config_edit_form.

File

core/modules/field_ui/field_ui.module, line 290

Code

function field_ui_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state) {
    $field_config = $form_state->getFormObject()
        ->getEntity();
    assert($field_config instanceof FieldConfigInterface);
    $form_id = 'field_storage_config_edit_form';
    $hook = 'form_' . $form_id;
    $field_storage_form = \Drupal::entityTypeManager()->getFormObject('field_storage_config', $form_state->getFormObject()
        ->getOperation());
    $field_storage_form->setEntity($field_config->getFieldStorageDefinition());
    $subform_state = SubformState::createForSubform($form['field_storage']['subform'], $form, $form_state, $field_storage_form);
    \Drupal::moduleHandler()->alterDeprecated('Use hook_form_field_config_edit_form_alter() instead. See https://www.drupal.org/node/3386675.', $hook, $form['field_storage']['subform'], $subform_state, $form_id);
    \Drupal::theme()->alter($hook, $form['field_storage']['subform'], $subform_state, $form_id);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.