diff --git a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php index bc0bdf3a27acac2541b70c9f79aa4b23431a21d0..b78a575f3c384ea29b0da89a1ead6332d7e86adb 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityConfirmFormBase.php @@ -43,6 +43,11 @@ public function getCancelText() { * {@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'; } diff --git a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php index d8c39e439fa07e49e623d7297bc315637939ff2d..8068b7539fb84f4cfd0caac1251ec33c3a62ede4 100644 --- a/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php +++ b/core/lib/Drupal/Core/Entity/EntityConfirmFormBase.php @@ -45,6 +45,11 @@ public function getCancelText() { * {@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'; } diff --git a/core/lib/Drupal/Core/Form/ConfirmFormBase.php b/core/lib/Drupal/Core/Form/ConfirmFormBase.php index 51cfbbf050022b64f6c792347e987a762c8972fb..8848ed15824a5ba006063fa4292beac1988ca1d7 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormBase.php @@ -32,6 +32,11 @@ public function getCancelText() { * {@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'; } diff --git a/core/modules/search/src/Form/ReindexConfirm.php b/core/modules/search/src/Form/ReindexConfirm.php index a9a2cd050dc66d4fbe414cb370800d306f6183bc..651ce4fe0ec77566a2e8e822880db67719ae97e7 100644 --- a/core/modules/search/src/Form/ReindexConfirm.php +++ b/core/modules/search/src/Form/ReindexConfirm.php @@ -59,15 +59,15 @@ 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) { - $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()); + } }