Reported by Felix Frost at: http://drupal.org/node/26966#comment-1178790 but while that issue covers the general issue of comment.module's crazy paging, we should fix this specific bug by itself.

We have no test coverage for paged comments at the moment - see #296483: TestingParty08: paged comments - will try to add one for this over the next couple of days, so leaving at needs work.

We'll also need to backport this to Drupal 6.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brianV’s picture

Problem summary (since not posted in this issue yet):

When posting a new comment that would be the first comment on a new page of comments, the comment submission form redirects you to the wrong page. When calculating which page to redirect you to, comment module only uses the currently existing number of comments, rather than the existing number plus the new comment.

Since nothing yet has come from #296483: TestingParty08: paged comments or #26966: Fix comment links when paging is used., I have taken the liberty of fixing up this patch, and rolling it against the current HEAD and D6.

Some tweaks:

  1. The comment has been shortened down to a more concise description
  2. Typo in $ccoment_number variable name fixes
brianV’s picture

D6 patch

brianV’s picture

Status: Needs work » Needs review

Apparently the change to 'needs review' didn't stick...

Status: Needs review » Needs work

The last submitted patch failed testing.

brianV’s picture

Oops - typo. Fixed patches below.

catch’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs backport to D6, +Quick fix

Given #296483: TestingParty08: paged comments has tests for this, and it's a one line patch, marking rtbc.

Dries’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Needs work

Committed to CVS HEAD. Thanks!

I tried applying to D6 but that failed so we might want to look into that again.

brianV’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
980 bytes

Re-rolled the D6 patch. Comment module appears to have been reorganized since I wrote the original. Also, renamed so it would be tested against D6 instead of D7 :p

Setting immediately to RTBC, since it's a trivial change, and was at that status in D7.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Just setting $comment_count and then not using it does not seem to be right.

brianV’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
1.07 KB

Oops. Sorry about that. New patch is correct. I promise!

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6 too, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Needs backport to D6, -Quick fix

Automatically closed -- issue fixed for 2 weeks with no activity.