Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.544 diff -u -r1.544 comment.module --- modules/comment/comment.module 20 May 2007 07:30:03 -0000 1.544 +++ modules/comment/comment.module 22 May 2007 23:56:41 -0000 @@ -1721,14 +1721,18 @@ return $form_values; } +function comment_last_page($nid) { + $last_page = ceil(comment_num_all($nid) / _comment_get_display_setting('comments_per_page')); + return ($last_page - 1); +} + function comment_form_submit(&$form_values, $form, &$form_state) { $form_values = _comment_form_submit($form_values); if ($cid = comment_save($form_values)) { - $form_state['redirect'] = array('node/'. $form_values['nid'], NULL, "comment-$cid"); + $form_state['redirect'] = array('node/'. $form_values['nid'], "page=".comment_last_page($form_values['nid']), "comment-$cid"); return; } } - /* ** Renderer or visualization functions this can be optionally ** overridden by themes.