Skip to content
Snippets Groups Projects
Commit a8800e4f authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #146667 by coofercat: fixed bug in form builder.

parent 31c357f9
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -69,11 +69,13 @@ function drupal_get_form($form_id) {
// to build it from scratch.
if (!isset($form)) {
$form_state['post'] = $_POST;
array_shift($args);
array_unshift($args, $form_state);
array_unshift($args, $form_id);
// Use a copy of the function's arguments for manipulation
$args_temp = $args;
array_shift($args_temp);
array_unshift($args_temp, $form_state);
array_unshift($args_temp, $form_id);
$form = call_user_func_array('drupal_retrieve_form', $args);
$form = call_user_func_array('drupal_retrieve_form', $args_temp);
$form_build_id = 'form-'. md5(mt_rand());
$form['#build_id'] = $form_build_id;
drupal_prepare_form($form_id, $form, $form_state);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment