From d1c46eadebd0650237322524afcb971addeebf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Sun, 4 Nov 2007 16:11:33 +0000 Subject: #187391 by jrbeeman, catch: redirect user to proper node comment page after submitting a new comment --- modules/comment/comment.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/comment/comment.module') diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 7c67a955d..509de92b8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1444,7 +1444,9 @@ function _comment_form_submit(&$comment_values) { function comment_form_submit($form, &$form_state) { _comment_form_submit($form_state['values']); if ($cid = comment_save($form_state['values'])) { - $form_state['redirect'] = array('node/'. $form_state['values']['nid'], NULL, "comment-$cid"); + $node = node_load($form_state['values']['nid']); + $page = comment_new_page_count($node->comment_count, 1, $node); + $form_state['redirect'] = array('node/'. $node->nid, $page, "comment-$cid"); return; } } -- cgit v1.2.3