Commit 5ec328b2 authored by alexpott's avatar alexpott

Issue #2301597 by joshi.rohit100: Remove drupal_prepare_form() as it is deprecated.

parent 3cfff373
......@@ -275,18 +275,6 @@ function drupal_process_form($form_id, &$form, &$form_state) {
\Drupal::formBuilder()->processForm($form_id, $form, $form_state);
}
/**
* Prepares a structured form array.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::formBuilder()->prepareForm().
*
* @see \Drupal\Core\Form\FormBuilderInterface::prepareForm().
*/
function drupal_prepare_form($form_id, &$form, &$form_state) {
\Drupal::formBuilder()->prepareForm($form_id, $form, $form_state);
}
/**
* Validates user-submitted form data in the $form_state array.
*
......
......@@ -342,7 +342,7 @@ function testEntityFormDisplayExtractFormValues() {
$values_2[1]['value'] = 0;
// Pretend the form has been built.
drupal_prepare_form('field_test_entity_form', $form, $form_state);
\Drupal::formBuilder()->prepareForm('field_test_entity_form', $form, $form_state);
drupal_process_form('field_test_entity_form', $form, $form_state);
$form_state['values'][$this->field_name] = $values;
$form_state['values'][$this->field_name_2] = $values_2;
......
......@@ -217,7 +217,7 @@ private function formSubmitHelper($form, $edit) {
$form_state['input'] = $edit;
$form_state['input']['form_id'] = $form_id;
drupal_prepare_form($form_id, $form, $form_state);
\Drupal::formBuilder()->prepareForm($form_id, $form, $form_state);
drupal_process_form($form_id, $form, $form_state);
......
......@@ -112,7 +112,7 @@ function testRequiredFields() {
// The form token CSRF protection should not interfere with this test,
// so we bypass it by setting the token to FALSE.
$form['#token'] = FALSE;
drupal_prepare_form($form_id, $form, $form_state);
\Drupal::formBuilder()->prepareForm($form_id, $form, $form_state);
drupal_process_form($form_id, $form, $form_state);
$errors = form_get_errors($form_state);
// Form elements of type 'radios' throw all sorts of PHP notices
......
......@@ -740,7 +740,7 @@ function hook_form_alter(&$form, &$form_state, $form_id) {
*
* @see hook_form_alter()
* @see hook_form_BASE_FORM_ID_alter()
* @see drupal_prepare_form()
* @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
* @see forms_api_reference.html
*/
function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
......@@ -786,7 +786,7 @@ function hook_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
*
* @see hook_form_alter()
* @see hook_form_FORM_ID_alter()
* @see drupal_prepare_form()
* @see \Drupal\Core\Form\FormBuilderInterface::prepareForm()
*/
function hook_form_BASE_FORM_ID_alter(&$form, &$form_state, $form_id) {
// Modification for the form with the given BASE_FORM_ID goes here. For
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment