comment_form_submit redirects to 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.

Members fund testing for the Drupal project. Drupal Association Learn more


catch’s picture

Category: task » bug

bug not task.

catch’s picture

Status: Active » Needs review

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

moshe weitzman’s picture

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

ChrisKennedy’s picture

Status: Needs review » Needs work

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

ChrisKennedy’s picture

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.

catch’s picture

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.

lilou’s picture

Version: 6.x-dev » 7.x-dev
Tor Arne Thune’s picture

Status: Postponed » Closed (fixed)
26.72 KB

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