diff --git a/core/modules/comment/src/Hook/CommentHooks.php b/core/modules/comment/src/Hook/CommentHooks.php index b4550ad66eb88afdfd9d8494c69c55c6efe442ee..81b48b9e18efed1f0bce8af5f7b273e55f8cf604 100644 --- a/core/modules/comment/src/Hook/CommentHooks.php +++ b/core/modules/comment/src/Hook/CommentHooks.php @@ -7,7 +7,6 @@ use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\user\UserInterface; use Drupal\user\RoleInterface; -use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\Display\EntityViewDisplayInterface; use Drupal\Core\Entity\EntityInterface; @@ -223,17 +222,6 @@ public function nodeViewAlter(array &$build, EntityInterface $node, EntityViewDi } } - /** - * Implements hook_form_FORM_ID_alter() for field_ui_field_storage_add_form. - */ - #[Hook('form_field_ui_field_storage_add_form_alter')] - 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')); - } - } - /** * Implements hook_field_info_entity_type_ui_definitions_alter(). */ @@ -244,28 +232,6 @@ public function fieldInfoEntityTypeUiDefinitionsAlter(array &$ui_definitions, st } } - /** - * Implements hook_form_FORM_ID_alter(). - */ - #[Hook('form_field_ui_form_display_overview_form_alter')] - public function formFieldUiFormDisplayOverviewFormAlter(&$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')); - } - } - - /** - * Implements hook_form_FORM_ID_alter(). - */ - #[Hook('form_field_ui_display_overview_form_alter')] - 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')); - } - } - /** * Implements hook_entity_storage_load(). *