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

Implements hook_form_FORM_ID_alter().

File

core/modules/comment/comment.module, line 264
Enables users to comment on published content.

Code

function comment_form_field_ui_display_overview_form_alter(&$form, FormStateInterface $form_state) {
  $route_match = \Drupal::routeMatch();
  if ($form['#entity_type'] == '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'));
  }
}