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

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 17 07:58:02 UTC 2010


#13939: get_page_of_comment returns wrong page number when changing threading level
--------------------------+-------------------------------------------------
 Reporter:  laceous       |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Comments      |     Version:  3.0
 Severity:  normal        |    Keywords:     
--------------------------+-------------------------------------------------
 Initial discussion settings:
  * Enable threaded comments 2 levels deep
  * 5 top-level comments per page, first page by default
  * Older comments at top of each page

 If I have comments on a post like:

 '''cpage 1'''
  * comment-1
  * comment-2
  * comment-3
  * comment-4
  * comment-5
   * comment-6

 {{{
 $page = get_page_of_comment(6); // returns 1 which is the correct page
 }}}

 If I modify the initial discussion settings by disabling threading (e.g.
 changing the threading level to 1), the comments change to:

 '''cpage 1'''
  * comment-1
  * comment-2
  * comment-3
  * comment-4
  * comment-5
 '''cpage 2'''
  * comment-6

 {{{
 $page = get_page_of_comment(6); // returns 1 which is incorrect
 }}}

 This function doesn't follow the same algorithm as what is used to display
 the comments

 This can potentially happen whenever you decrease the threading level from
 x to x-n

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13939>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list