diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-13 20:51:29 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-13 20:51:29 +0000 |
commit | dbd1c4f1da6dd480d56821f4c28cd27f730780bd (patch) | |
tree | fd7c5cc5b9b1ce3f11064251d2bfcbeadf7ae565 | |
parent | df2e5ef505d954230956a4109aebf72198e4a3f4 (diff) | |
download | brdo-dbd1c4f1da6dd480d56821f4c28cd27f730780bd.tar.gz brdo-dbd1c4f1da6dd480d56821f4c28cd27f730780bd.tar.bz2 |
- 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.
-rw-r--r-- | modules/comment.module | 10 | ||||
-rw-r--r-- | modules/comment/comment.module | 10 |
2 files changed, 8 insertions, 12 deletions
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']); } } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 2ca3a39a3..aa4005acb 100644 --- a/modules/comment/comment.module +++ b/modules/comment/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']); } } |