[wp-trac] [WordPress Trac] #13939: get_page_of_comment returns wrong page number when changing threading level

WordPress Trac noreply at wordpress.org
Sat Oct 3 19:52:20 UTC 2015


#13939: get_page_of_comment returns wrong page number when changing threading level
--------------------------+---------------------------
 Reporter:  laceous       |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.4
Component:  Comments      |     Version:  3.0
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |     Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):

 * keywords:  needs-patch =>
 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 I've addressed a few of these issues in the commits above. As for what
 remains:

 > If you have threaded comments and then disable threading, the comment
 page returned can be incorrect. (initial issue reported; ignore the x to
 x-n... I was wrong there)

 I can't reproduce this. The logic of the function was largely rewritten in
 [34535], and it's possible that the rewrite fixed things.

 > The comment type was not allowing "pings" which is one of the values
 wp_list_comments allows

 The value of 'type' is now passed directly to `WP_Comment_Query`, so you
 can use whatever values are accepted there.

 > This function wasn't taking into account unapproved comments for the
 current user like the comments_template function does.

 I'm inclined to do nothing about this. I thought about adding `status` and
 `include_unapproved` args to the function, and passing them to
 `WP_Comment_Query`. But at this point, it begins to confuse what the
 function (and indeed, what comment pagination is for). In theory, the page
 on which a comment appears is supposed to be immutable - it shouldn't
 change over time, because the comment page is used as part of the comment
 permalink. This is not really true in practice, because of things like
 unapproved-to-approved comments, changed comments_per_page, and so forth.
 But adding additional params that allow more bypassing of this logic
 doesn't seem right to me. In some ideal world, `comments_template()`
 shouldn't be adjusting pagination for unapproved comments either, but
 that's a whole other ball of wax.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/13939#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list