From dbd1c4f1da6dd480d56821f4c28cd27f730780bd Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 13 Jul 2004 20:51:29 +0000 Subject: - Patch #9253 by Morbus: fixed bug that manifested itself with a duplicate page when a user has submitted a comment that goes into the moderation queue. Part of the problem seemed to be that the "your comment is in the moderation queue" message was set as a theme print, as opposed to a drupal_set_message(). This patch fixes that, as well as adding a drupal_goto() to redirect the user back to where they came. --- modules/comment.module | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'modules/comment.module') diff --git a/modules/comment.module b/modules/comment.module index 2ca3a39a3..aa4005acb 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -670,15 +670,13 @@ function comment_post($edit) { // Clear the cache so an anonymous user can see his comment being added. cache_clear_all(); - /* - ** Redirect the user the node he commented on, or explain queue - */ - + // Explain the moderation queue if necessary, and then + // redirect the user to the node he's commenting on. if ($status == 1) { - print theme('page', t('Your comment has been queued for moderation by site administrators and will be published after approval.')); + drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.')); + drupal_goto('node/'. $edit['nid']); } else { - // Redirect the user to his comment: drupal_goto('node/'. $edit['nid'] .'#comment-'. $edit['cid']); } } -- cgit v1.2.3