Commit dbd1c4f1 authored by Dries's avatar Dries

- 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.
parent df2e5ef5
......@@ -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']);
}
}
......
......@@ -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']);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment