function comment_form_field_ui_field_storage_add_form_alter

Same name and namespace in other branches
  1. 9 core/modules/comment/comment.module \comment_form_field_ui_field_storage_add_form_alter()
  2. 8.9.x core/modules/comment/comment.module \comment_form_field_ui_field_storage_add_form_alter()
  3. 10 core/modules/comment/comment.module \comment_form_field_ui_field_storage_add_form_alter()

Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.

File

core/modules/comment/comment.module, line 235

Code

function comment_form_field_ui_field_storage_add_form_alter(&$form, FormStateInterface $form_state) {
    $route_match = \Drupal::routeMatch();
    if ($form_state->get('entity_type_id') == 'comment' && $route_match->getParameter('commented_entity_type')) {
        $form['#title'] = \Drupal::service('comment.manager')->getFieldUIPageTitle($route_match->getParameter('commented_entity_type'), $route_match->getParameter('field_name'));
    }
}

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