From 0e240bb7d52e2fa1b577f98eff273cd958fd71f7 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Sun, 13 Jul 2014 13:22:36 -0700
Subject: [PATCH] Issue #2301591 by joshi.rohit100: Remove
 drupal_rebuild_form() as it is deprecated.

---
 core/includes/form.inc                               | 12 ------------
 .../system/src/Controller/FormAjaxController.php     |  2 +-
 core/modules/system/src/Tests/Form/RebuildTest.php   |  2 +-
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/core/includes/form.inc b/core/includes/form.inc
index 1b58d1202ce5..acb81e866106 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -142,18 +142,6 @@ function drupal_build_form($form_id, &$form_state) {
   return \Drupal::formBuilder()->buildForm($form_id, $form_state);
 }
 
-/**
- * Constructs a new $form from the information in $form_state.
- *
- * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
- *   Use \Drupal::formBuilder()->rebuildForm().
- *
- * @see \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
- */
-function drupal_rebuild_form($form_id, &$form_state, $old_form = NULL) {
-  return \Drupal::formBuilder()->rebuildForm($form_id, $form_state, $old_form);
-}
-
 /**
  * Fetches a form from the cache.
  *
diff --git a/core/modules/system/src/Controller/FormAjaxController.php b/core/modules/system/src/Controller/FormAjaxController.php
index 4b5f78555237..bc43c4906355 100644
--- a/core/modules/system/src/Controller/FormAjaxController.php
+++ b/core/modules/system/src/Controller/FormAjaxController.php
@@ -90,7 +90,7 @@ protected function getForm(Request $request) {
 
     // When a form is rebuilt after Ajax processing, its #build_id and #action
     // should not change.
-    // @see drupal_rebuild_form()
+    // @see \Drupal\Core\Form\FormBuilderInterface::rebuildForm()
     $form_state['rebuild_info']['copy']['#build_id'] = TRUE;
     $form_state['rebuild_info']['copy']['#action'] = TRUE;
 
diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php
index 7cba668f1302..754a3033bc14 100644
--- a/core/modules/system/src/Tests/Form/RebuildTest.php
+++ b/core/modules/system/src/Tests/Form/RebuildTest.php
@@ -11,7 +11,7 @@
 use Drupal\simpletest\WebTestBase;
 
 /**
- * Tests functionality of drupal_rebuild_form().
+ * Tests functionality of \Drupal\Core\Form\FormBuilderInterface::rebuildForm().
  *
  * @group Form
  * @todo Add tests for other aspects of form rebuilding.
-- 
GitLab