function CommentHooks::formFieldUiDisplayOverviewFormAlter

Implements hook_form_FORM_ID_alter().

File

core/modules/comment/src/Hook/CommentHooks.php, line 257

Class

CommentHooks
Hook implementations for comment.

Namespace

Drupal\comment\Hook

Code

public function formFieldUiDisplayOverviewFormAlter(&$form, FormStateInterface $form_state) : void {
    $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'));
    }
}

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