diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-02 20:24:17 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-07-02 20:24:17 +0000 |
commit | d048681f03b495256dbd52672a2a6e717425a5b0 (patch) | |
tree | a4d67d0ac4528bdb1405943d763e4c0acf0bfbb2 /includes/form.inc | |
parent | fcee5e4f89f4955e3db7241c26d5f40ccf0ff45c (diff) | |
download | brdo-d048681f03b495256dbd52672a2a6e717425a5b0.tar.gz brdo-d048681f03b495256dbd52672a2a6e717425a5b0.tar.bz2 |
#63990 by Heine and chx, allow commenting on nodes containing forms
Diffstat (limited to 'includes/form.inc')
-rw-r--r-- | includes/form.inc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/form.inc b/includes/form.inc index 79c587bcf..55910c175 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -60,6 +60,11 @@ function element_children($element) { */ function drupal_get_form($form_id, &$form, $callback = NULL) { global $form_values, $form_submitted, $user, $form_button_counter; + static $saved_globals = array(); + + // Save globals in case of indirect recursive call + array_push($saved_globals, array($form_values, $form_submitted, $form_button_counter)); + $form_values = array(); $form_submitted = FALSE; $form_button_counter = array(0, 0); @@ -155,7 +160,10 @@ function drupal_get_form($form_id, &$form, $callback = NULL) { } } - return form_render($form); + $output = form_render($form); + // Restore globals + list($form_values, $form_submitted, $form_button_counter) = array_pop($saved_globals); + return $output; } function drupal_validate_form($form_id, $form, $callback = NULL) { |