[wp-trac] [WordPress Trac] #8973: Function get_page_of_comment() returns incorrect page numbers

WordPress Trac noreply at wordpress.org
Fri Apr 6 13:39:55 UTC 2018


#8973: Function get_page_of_comment() returns incorrect page numbers
------------------------------------+-----------------------------
 Reporter:  GregMulhauser           |       Owner:  chriscct7
     Type:  defect (bug)            |      Status:  reviewing
 Priority:  normal                  |   Milestone:  Future Release
Component:  Comments                |     Version:  2.7
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+-----------------------------
Changes (by matjack1):

 * keywords:  dev-feedback needs-refresh => dev-feedback has-patch


Comment:

 I've managed to reproduce the error by publishing a number of unapproved
 comments higher than comments pagination and then an approved comment.

 For example in the following screenshot I'm on the second page of comments
 just because of unapproved comments:

 [[Image(https://core.trac.wordpress.org/raw-
 attachment/ticket/8973/Screenshot%20from%202018-04-06%2015-34-19.png)]]

 In this case if I'm the author of the unapproved comments the links in the
 "Recent comments" section were wrong.

 The attached patch is fixing this issue and removing some duplication in
 the file. I don't know if you like the code like this or if I should
 extract the added template lines in a separate function. I'm happy to
 update the patch if you think that's better.

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


More information about the wp-trac mailing list