[wp-trac] [WordPress Trac] #22312: Notice for media attached to "retired" custom post type

WordPress Trac noreply at wordpress.org
Tue Oct 30 13:47:16 UTC 2012


#22312: Notice for media attached to "retired" custom post type
-----------------------------+--------------------------
 Reporter:  trepmal          |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:                   |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 If there are attachments in the Media Library that are attached to non-
 existant post types, a few ugly notices will appear:

 `Notice: Trying to get property of non-object in /path/to/wp-
 includes/capabilities.php on line 1080`

 `Notice: Trying to get property of non-object in /path/to/wp-
 includes/capabilities.php on line 1081`

 `Notice: Trying to get property of non-object in /path/to/wp-
 includes/capabilities.php on line 1081`

 `Notice: Trying to get property of non-object in /path/to/wp-
 includes/capabilities.php on line 1084`

 `Notice: Trying to get property of non-object in /path/to/wp-
 includes/capabilities.php on line 1084`

 [[Image(http://cdn.dropmark.com/17023/0b51ddeeb3862946e6c6977438a5bdcc12948d2f/2012-10-28_0836.png)]]

 I've included a patch, but I'm sure it's not the optimal solution.

 Not sure if there should there be some way to indicate to the user that
 the attachment's post_parent is a "retired" post type

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


More information about the wp-trac mailing list