[wp-trac] [WordPress Trac] #25477: Notice: Trying to get property of non-object in .../wp-includes/post.php on line 2847

WordPress Trac noreply at wordpress.org
Tue Feb 11 17:32:36 UTC 2014


#25477: Notice:  Trying to get property of non-object in .../wp-includes/post.php
on line 2847
--------------------------+-----------------------
 Reporter:  jpswade       |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------
Changes (by jpswade):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 I've managed to reproduce this error again today.

 {{{
 Notice: Trying to get property of non-object in /home/.../public_html/wp-
 includes/post.php on line 2925
 }}}

 Although I agree that Wordpress *should NOT* suppress errors, I firmly
 believe that better error handling should be introduced.

 The problem is that the error is occurring in post.php in the
 wp_insert_attachment() function. On line 2925, the error is because
 get_taxonomy() in taxonomy.php is returning false rather than an object.

 Either, get_taxonomy() should give an error (rather than just returning
 false) or wp_insert_attachment() should check that get_taxonomy() is
 actually returning an object or return an error.

 Again I am firmly saying that errors should *NOT* be suppressed and in
 fact I'm saying they should be handled.

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


More information about the wp-trac mailing list