[wp-trac] [WordPress Trac] #29660: Functions in wp_includes/query.php assume non-null return value from get_queried_object

WordPress Trac noreply at wordpress.org
Wed Dec 16 22:40:05 UTC 2015


#29660: Functions in wp_includes/query.php assume non-null return value from
get_queried_object
-------------------------------+------------------------------
 Reporter:  yellyc             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  4.0
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by Howdy_McGee):

 It's really unfortunate that this doesn't get as much attention since it's
 a persistent problem. The biggest issue I think is that the errors being
 generated don't reflect the exact issue, where it's originating from, or
 the cause. Right now it's all the same generic message.

 I can replicate errors like this in `pre_get_posts` just as I can in
 ''any'' other form but it doesn't tell me ''why'' it's happening. The
 duplicate ticket above [#33729] errors out whenever passing strings to
 `is_category()` and the category isn't found. That's not very intuitive
 and to get around it I have to use some pretty funky logic. If it is
 decided that the core errors aren't worth fixing then I think we should
 also dump additional information to the developers as to ''why'' the
 errors occur. Though, personally I think that since the functions are
 being used correctly then the solution should be patching the core
 functions to reflect these cases.

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


More information about the wp-trac mailing list