From 668ba96c91195cff1b96691c4d73657239c836fd Mon Sep 17 00:00:00 2001
From: catch <6915-catch@users.noreply.drupalcode.org>
Date: Mon, 17 Mar 2025 13:05:50 +0000
Subject: [PATCH] Issue #3513000 by nicxvan: Delete comment module form alters
 calling getFieldUIPageTitle

---
 .../modules/comment/src/Hook/CommentHooks.php | 34 -------------------
 1 file changed, 34 deletions(-)

diff --git a/core/modules/comment/src/Hook/CommentHooks.php b/core/modules/comment/src/Hook/CommentHooks.php
index b4550ad66eb8..81b48b9e18ef 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().
    *
-- 
GitLab