From a8800e4f2694a0107bbf425212bdccb1fe81f5cb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 26 Aug 2007 07:31:48 +0000 Subject: - Patch #146667 by coofercat: fixed bug in form builder. --- includes/form.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/form.inc b/includes/form.inc index 0bbc04867..7be8fb061 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -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); -- cgit v1.2.3