function CommentHooks::formFieldUiFieldStorageAddFormAlter
Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form.
File
-
core/
modules/ comment/ src/ Hook/ CommentHooks.php, line 225
Class
- CommentHooks
- Hook implementations for comment.
Namespace
Drupal\comment\HookCode
public function formFieldUiFieldStorageAddFormAlter(&$form, FormStateInterface $form_state) : void {
$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.