[wp-trac] [WordPress Trac] #26901: Warning line 1059 in post-template.php

WordPress Trac noreply at wordpress.org
Fri Oct 17 06:13:23 UTC 2014


#26901: Warning line 1059 in post-template.php
-------------------------------+------------------------
 Reporter:  tunjic             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  4.1
Component:  Posts, Post Types  |     Version:  3.5
 Severity:  minor              |  Resolution:
 Keywords:  has-patch          |     Focuses:  multisite
-------------------------------+------------------------
Changes (by jeremyfelt):

 * keywords:   => has-patch
 * version:  3.8 => 3.5
 * milestone:  Awaiting Review => 4.1


Comment:

 Thanks for the bug report @tunjic.

 It seems this can happen if the walker gets a list of pages and one does
 not exist. We actually used to check for `$_current_page->ancestors` here
 before some other cleanup in [21559] got rid of it. I'm not sure that this
 is specifically multisite related, but the use of `switch_to_blog()` could
 be resulting in the query of some post IDs that exist on one site and not
 the other.

 [https://core.trac.wordpress.org/attachment/ticket/26901/26901.diff
 26901.diff] adds a check to make sure we didn't receive `null` back from
 `get_post()`. We do the same thing a bit farther down before looking for a
 post parent.

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


More information about the wp-trac mailing list