comment_form_submit redirects to example.com/node/123#comment-123 regardless of whether the comments span multiple pages or not. This means that if you reply from page 3, you end up back at the original node rather than your own comment, and have to use the pager (and some scrolling often) to get back to it.

This patch adds a function comment_last_page, and changes the $form_state['redirect'] behaviour to go to the correct page, so users will still see their new comment if it's on a subsequent page.

If comments are moderated, then users don't see their comment, this is consistent with current behaviour, except they'll be on the page they replied from.

tested in 5.1, this is against 6.x though so hopefully I got the changes right.

Comments

Category:task» bug

bug not task.

Status:Active» Needs review

must do more than one form selection per reply. sorry.

is the new comment always on last page? what about threaded view?

Status:Needs review» Needs work

Moshe is right, this will go to the wrong page if comments are threaded.

And even if comments aren't threaded, new comments might go at the beginning (first page rather than last page).

#new links don't work across multiple pages is a similar issue, and I see all three of us have already commented on it.

Status:Needs work» Postponed

you're right, again. :(

Seems like the only way is for a big switch statement (like last patch on that other issue), which is a bit kludgy, or a different way to display comments, which won't get in to drupal 6. I'm planning to get a bit better at all this by D7 code freeze, and will try to come up with something that'll fix ll these related issues properly.

Version:6.x-dev» 7.x-dev

Status:Postponed» Closed (fixed)
StatusFileSize
new26.72 KB

This is fixed in Drupal 7. I end up on the page of the comment I just submitted.