- 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.

4.5.x
Dries Buytaert 2004-07-13 20:51:29 +00:00
parent df2e5ef505
commit dbd1c4f1da
2 changed files with 8 additions and 12 deletions

View File

@ -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']);
}
}

View File

@ -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']);
}
}