summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/form.inc10
-rw-r--r--modules/comment.module2
-rw-r--r--modules/comment/comment.module2
3 files changed, 11 insertions, 3 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) {
diff --git a/modules/comment.module b/modules/comment.module
index bb96f6d27..46dce36ba 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -1450,7 +1450,7 @@ function comment_form_add_preview($form, $edit) {
$output .= theme('comment_view', $comment);
}
else {
- $output .= node_view(node_load($edit['nid']));
+ $form['#suffix'] = node_view(node_load($edit['nid']));
$edit['pid'] = 0;
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index bb96f6d27..46dce36ba 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1450,7 +1450,7 @@ function comment_form_add_preview($form, $edit) {
$output .= theme('comment_view', $comment);
}
else {
- $output .= node_view(node_load($edit['nid']));
+ $form['#suffix'] = node_view(node_load($edit['nid']));
$edit['pid'] = 0;
}