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.
Comment | File | Size | Author |
---|---|---|---|
#10 | comment_form_submit_redirect_fix-rev4-D6.patch | 1.07 KB | brianV |
#8 | comment_form_submit_redirect_fix-rev3-D6.patch | 980 bytes | brianV |
#5 | comment_form_submit_redirect_fix-D6-rev2.patch | 1.04 KB | brianV |
#5 | comment_form_submit_redirect_fix-D7-rev2.patch | 1.03 KB | brianV |
#2 | comment_form_submit_redirect_fix-D6.patch | 1013 bytes | brianV |
Comments
Comment #1
brianV CreditAttribution: brianV commentedProblem 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:
$ccoment_number
variable name fixesComment #2
brianV CreditAttribution: brianV commentedD6 patch
Comment #3
brianV CreditAttribution: brianV commentedApparently the change to 'needs review' didn't stick...
Comment #5
brianV CreditAttribution: brianV commentedOops - typo. Fixed patches below.
Comment #6
catchGiven #296483: TestingParty08: paged comments has tests for this, and it's a one line patch, marking rtbc.
Comment #7
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
I tried applying to D6 but that failed so we might want to look into that again.
Comment #8
brianV CreditAttribution: brianV commentedRe-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.
Comment #9
Gábor HojtsyJust setting $comment_count and then not using it does not seem to be right.
Comment #10
brianV CreditAttribution: brianV commentedOops. Sorry about that. New patch is correct. I promise!
Comment #11
Gábor HojtsyCommitted to Drupal 6 too, thanks.