Opened 15 years ago
Last modified 5 years ago
#11248 assigned defect (bug)
Paged wp_list_comments() should always output something
Reported by: | Viper007Bond | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Enable comment paging on your blog and visit http://yourblog.com/a/single/post/comment-page-999999/
. Note no comments will be displayed.
There's situations where the comment form will redirect you back to the wrong page (for example if you mess with the type parameter and exclude pings). The Walker should detect if there's no comments to be displayed on the requested page and if that's the case, then display the latest page that actually has comments.
Attachments (4)
Change History (22)
#2
@
10 years ago
- Keywords needs-refresh dev-feedback added; has-patch removed
Seems to still be valid in 4.0
#7
@
9 years ago
- Keywords needs-refresh added
@couturefreak Thanks for the patch. Would you mind refreshing it without the extra formatting fixes?
#8
@
9 years ago
- Milestone changed from Future Release to 4.4
- Owner set to wonderboymusic
- Status changed from new to assigned
#9
@
9 years ago
- Keywords needs-patch added; dev-feedback has-patch needs-refresh removed
This should be a fix in canonical
@
9 years ago
In redirect_canonical()
redirect comment pages that are larger than the maximum comment page to the post itself.
#12
@
9 years ago
- Keywords has-patch added; needs-patch removed
11248.2.patch fixes the issue as @wonderboymusic suggested.
Canonical unit test case included.
This will basically redirect the comment page links for pages that are larger than the maximum to the post link.
So for example if there is a maximum of 3 comment pages,
/comment-test/comment-page-4/
will redirect to
/comment-test/
.
#13
@
9 years ago
- Keywords needs-patch added; has-patch removed
Let's not pull up every single comment object belonging to a post to determine the page of comment. I recently wrote something that is a little more lightweight for determining the number of top-level comments on a post - see the top_level_count
logic in [34729]. Maybe we can separate this out, and use it to determine the number of comment pages here.
@
9 years ago
Updating the previous patch to use a more efficient way of getting the total comment pages (props @boonebgorges for the suggestion)
#14
@
9 years ago
- Keywords has-patch added; needs-patch removed
Makes sense. I've updated the patch to use the solution @boonebgorges suggested for fetching the number of top level comments. This is used when calculating the total number of comment pages.
#15
@
9 years ago
- Owner set to boonebgorges
I wrote a set of functions to do the number-of-pages calculation in https://core.trac.wordpress.org/attachment/ticket/8071/8071.8.diff. I'm going to wait to land that before taking care of the current ticket.
Fixed.