[wp-trac] [WordPress Trac] #20633: wp-includes/comment.php:738 - Undefined property: WP_Query::$comments

WordPress Trac noreply at wordpress.org
Fri Mar 15 04:05:30 UTC 2013


#20633: wp-includes/comment.php:738 - Undefined property: WP_Query::$comments
------------------------------------+------------------------------
 Reporter:  markjaquith             |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Warnings/Notices        |     Version:  3.3.2
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------------

Comment (by kitchin):

 Easiest place to see this bug is before the Loop. I put a note about that
 in the Codex, since then the function returns 0 with or without the bug
 fix.
 http://codex.wordpress.org/index.php?title=Function_Reference%2Fget_comment_pages_count&diff=128919&oldid=126895

 A test for this bug is to set WP_DEBUG to true. In wp-
 content/themes/twentythirteen/single.php insert
 {{{
   <?php printf('<pre>get_comment_pages_count=%s</pre>',
      get_comment_pages_count()); ?>
 }}}
 before and after the loop starts, at
 {{{
   <?php comments_template(); ?>
 }}}
 And look at the Hello World post.
 Expect 0 then 1, with 1 warning before the bug and no warnings after.
 Another test is to make sure
 {{{
   <?php printf('<pre>get_comment_pages_count=%s</pre>',
      get_comment_pages_count($GLOBALS['wp_query']->comments)); ?>
 }}}
 still works after the Loop. Expect 1.

 But I didn't see anything similar in the unit tests as far as I could
 tell.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20633#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list