From c57aa8128a6a1e89be78ffd84b66a457f7de6881 Mon Sep 17 00:00:00 2001
From: niharika <niharika.s@virasatsolutions.com>
Date: Wed, 8 Jan 2025 17:21:46 +0530
Subject: [PATCH 1/5]  remove form condition

---
 core/modules/search/src/Form/ReindexConfirm.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php
index a9a2cd050dc6..7d5aeab5bea4 100644
--- a/core/modules/search/src/Form/ReindexConfirm.php
+++ b/core/modules/search/src/Form/ReindexConfirm.php
@@ -59,7 +59,7 @@ public function getCancelUrl() {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    if ($form['confirm']) {
+    
       // Ask each active search page to mark itself for re-index.
       $search_page_repository = \Drupal::service('search.search_page_repository');
       foreach ($search_page_repository->getIndexableSearchPages() as $entity) {
@@ -67,7 +67,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
       }
       $this->messenger()->addStatus($this->t('All search indexes will be rebuilt.'));
       $form_state->setRedirectUrl($this->getCancelUrl());
-    }
+    
   }
 
 }
-- 
GitLab


From d28d186dd5a7b0e470810cd5adab94f28913f06e Mon Sep 17 00:00:00 2001
From: arunsahijpal <arunsahijpal111@gmail.com>
Date: Thu, 6 Feb 2025 17:58:01 +0530
Subject: [PATCH 2/5] Issue #3497021: Added deprecated message.

---
 .../Entity/ContentEntityConfirmFormBase.php    | 18 ++++++++++++------
 .../Core/Entity/EntityConfirmFormBase.php      | 18 ++++++++++++------
 core/lib/Drupal/Core/Form/ConfirmFormBase.php  | 18 ++++++++++++------
 3 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
index bc0bdf3a27ac..5ce7ce65c2ae 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
@@ -39,12 +39,18 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormName() {
-    return 'confirm';
-  }
+/**
+ * {@inheritdoc}
+ *
+ * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
+ *   Implementations should remove this method.
+ *
+ * @see https://www.drupal.org/node
+ */
+public function getFormName() {
+  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+  return 'confirm';
+}
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
index d8c39e439fa0..c74cc39d65df 100644
--- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
@@ -41,12 +41,18 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormName() {
-    return 'confirm';
-  }
+/**
+ * {@inheritdoc}
+ *
+ * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
+ *   Implementations should remove this method.
+ *
+ * @see https://www.drupal.org/node
+ */
+public function getFormName() {
+  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+  return 'confirm';
+}
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
index 51cfbbf05002..808a4b4ba545 100644
--- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
@@ -28,12 +28,18 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormName() {
-    return 'confirm';
-  }
+/**
+ * {@inheritdoc}
+ *
+ * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
+ *   Implementations should remove this method.
+ *
+ * @see https://www.drupal.org/node
+ */
+public function getFormName() {
+  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+  return 'confirm';
+}
 
   /**
    * {@inheritdoc}
-- 
GitLab


From c4f08b1d36f308c57eba9fda0ad10ff540537651 Mon Sep 17 00:00:00 2001
From: Vladimir Roudakov <44088-VladimirAus@users.noreply.drupalcode.org>
Date: Fri, 7 Feb 2025 04:32:02 +0000
Subject: [PATCH 3/5] Issue #3497021 by vladimiraus:
 ConfirmFormInterface::getFormName() serves no purpose in ConfirmFormBase

---
 .../Entity/ContentEntityConfirmFormBase.php   | 24 +++++++++----------
 .../Core/Entity/EntityConfirmFormBase.php     |  4 ++--
 core/lib/Drupal/Core/Form/ConfirmFormBase.php | 24 +++++++++----------
 .../search/src/Form/ReindexConfirm.php        | 14 +++++------
 4 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
index 5ce7ce65c2ae..785af4879cc0 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
@@ -39,18 +39,18 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-/**
- * {@inheritdoc}
- *
- * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
- *   Implementations should remove this method.
- *
- * @see https://www.drupal.org/node
- */
-public function getFormName() {
-  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
-  return 'confirm';
-}
+  /**
+   * {@inheritdoc}
+   *
+   * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
+   *   Implementations should remove this method.
+   *
+   * @see https://www.drupal.org/node
+   */
+  public function getFormName() {
+    @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+    return 'confirm';
+  }
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
index c74cc39d65df..3f3ba5466a55 100644
--- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
@@ -44,13 +44,13 @@ public function getCancelText() {
 /**
  * {@inheritdoc}
  *
- * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
+ * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
  *   Implementations should remove this method.
  *
  * @see https://www.drupal.org/node
  */
 public function getFormName() {
-  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+  @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
   return 'confirm';
 }
 
diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
index 808a4b4ba545..53512d7e85c7 100644
--- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
@@ -28,18 +28,18 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-/**
- * {@inheritdoc}
- *
- * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
- *   Implementations should remove this method.
- *
- * @see https://www.drupal.org/node
- */
-public function getFormName() {
-  @trigger_error('getFormName() is deprecated and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
-  return 'confirm';
-}
+  /**
+   * {@inheritdoc}
+   *
+   * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
+   *   Implementations should remove this method.
+   *
+   * @see https://www.drupal.org/node
+   */
+  public function getFormName() {
+    @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+    return 'confirm';
+  }
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php
index 7d5aeab5bea4..651ce4fe0ec7 100644
--- a/core/modules/search/src/Form/ReindexConfirm.php
+++ b/core/modules/search/src/Form/ReindexConfirm.php
@@ -60,13 +60,13 @@ public function getCancelUrl() {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     
-      // Ask each active search page to mark itself for re-index.
-      $search_page_repository = \Drupal::service('search.search_page_repository');
-      foreach ($search_page_repository->getIndexableSearchPages() as $entity) {
-        $entity->getPlugin()->markForReindex();
-      }
-      $this->messenger()->addStatus($this->t('All search indexes will be rebuilt.'));
-      $form_state->setRedirectUrl($this->getCancelUrl());
+    // Ask each active search page to mark itself for re-index.
+    $search_page_repository = \Drupal::service('search.search_page_repository');
+    foreach ($search_page_repository->getIndexableSearchPages() as $entity) {
+      $entity->getPlugin()->markForReindex();
+    }
+    $this->messenger()->addStatus($this->t('All search indexes will be rebuilt.'));
+    $form_state->setRedirectUrl($this->getCancelUrl());
     
   }
 
-- 
GitLab


From d96f7defa34b61b1906fc71b44bf39357d4bc4c4 Mon Sep 17 00:00:00 2001
From: Vladimir Roudakov <44088-VladimirAus@users.noreply.drupalcode.org>
Date: Fri, 7 Feb 2025 04:57:27 +0000
Subject: [PATCH 4/5] Added change record.

---
 core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php | 2 +-
 core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php        | 2 +-
 core/lib/Drupal/Core/Form/ConfirmFormBase.php                | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
index 785af4879cc0..bbecceefb78b 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
@@ -45,7 +45,7 @@ public function getCancelText() {
    * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
    *   Implementations should remove this method.
    *
-   * @see https://www.drupal.org/node
+   * @see https://www.drupal.org/node/3505037
    */
   public function getFormName() {
     @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
index 3f3ba5466a55..2b456041963b 100644
--- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
@@ -47,7 +47,7 @@ public function getCancelText() {
  * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
  *   Implementations should remove this method.
  *
- * @see https://www.drupal.org/node
+ * @see https://www.drupal.org/node/3505037
  */
 public function getFormName() {
   @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
index 53512d7e85c7..70173b2ddcd2 100644
--- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
@@ -34,7 +34,7 @@ public function getCancelText() {
    * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
    *   Implementations should remove this method.
    *
-   * @see https://www.drupal.org/node
+   * @see https://www.drupal.org/node/3505037
    */
   public function getFormName() {
     @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
-- 
GitLab


From 28559d0ce7b524ebed7c5d5f0f0e6c543fa96341 Mon Sep 17 00:00:00 2001
From: arunsahijpal <arunsahijpal111@gmail.com>
Date: Mon, 10 Feb 2025 13:08:01 +0530
Subject: [PATCH 5/5] Issue #3497021: Updated deprecated message.

---
 .../Entity/ContentEntityConfirmFormBase.php   | 11 ++++-----
 .../Core/Entity/EntityConfirmFormBase.php     | 23 +++++++++----------
 core/lib/Drupal/Core/Form/ConfirmFormBase.php | 11 ++++-----
 3 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
index bbecceefb78b..b78a575f3c38 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php
@@ -41,14 +41,13 @@ public function getCancelText() {
 
   /**
    * {@inheritdoc}
-   *
-   * @deprecated in drupal:11.0.0 and is scheduled for removal in drupal:12.0.0.
-   *   Implementations should remove this method.
-   *
-   * @see https://www.drupal.org/node/3505037
    */
   public function getFormName() {
-    @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+    @trigger_error(
+      'ConfirmFormBase::getFormName() is deprecated in drupal:11.2.0 and will be removed in drupal:12.0.0. 
+      Implementations should remove this method. See https://www.drupal.org/node/3505037',
+      E_USER_DEPRECATED
+    );
     return 'confirm';
   }
 
diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
index 2b456041963b..8068b7539fb8 100644
--- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php
@@ -41,18 +41,17 @@ public function getCancelText() {
     return $this->t('Cancel');
   }
 
-/**
- * {@inheritdoc}
- *
- * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
- *   Implementations should remove this method.
- *
- * @see https://www.drupal.org/node/3505037
- */
-public function getFormName() {
-  @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
-  return 'confirm';
-}
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormName() {
+    @trigger_error(
+    'ConfirmFormBase::getFormName() is deprecated in drupal:11.2.0 and will be removed in drupal:12.0.0. 
+    Implementations should remove this method. See https://www.drupal.org/node/3505037',
+    E_USER_DEPRECATED
+    );
+    return 'confirm';
+  }
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
index 70173b2ddcd2..8848ed15824a 100644
--- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php
+++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php
@@ -30,14 +30,13 @@ public function getCancelText() {
 
   /**
    * {@inheritdoc}
-   *
-   * @deprecated in drupal:11.2.0 and is scheduled for removal in drupal:12.0.0.
-   *   Implementations should remove this method.
-   *
-   * @see https://www.drupal.org/node/3505037
    */
   public function getFormName() {
-    @trigger_error('getFormName() is deprecated in Drupal 11.2.0 and will be removed in Drupal 12.0.0.', E_USER_DEPRECATED);
+    @trigger_error(
+      'ConfirmFormBase::getFormName() is deprecated in drupal:11.2.0 and will be removed in drupal:12.0.0. 
+      Implementations should remove this method. See https://www.drupal.org/node/3505037',
+      E_USER_DEPRECATED
+    );
     return 'confirm';
   }
 
-- 
GitLab