[wp-trac] [WordPress Trac] #27802: Notice: Illegal member variable name in media.php on line 2418 due to invalid attachment

WordPress Trac noreply at wordpress.org
Tue Apr 15 05:50:01 UTC 2014


#27802: Notice: Illegal member variable name in media.php on line 2418 due to
invalid attachment
--------------------------+--------------------
 Reporter:  bobbingwide   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by jeremyfelt):

 When a theme upload fails due to a duplicate, its mime type is not stored
 in the database. `wp_count_attachments()` looks for all attachments and
 groups them using mime type as a key. When a mime type is not available,
 this key is empty.

 [https://core.trac.wordpress.org/attachment/ticket/27802/27802.2.diff
 27802.2.diff] checks for those empty requests and stores them under the
 'unknown' key. This preserves a total count and avoids the issue of an
 unknown key. It also introduces 'unknown', which may be weird.

 Another option is to just skip that attachment all together when counting,
 which [https://core.trac.wordpress.org/attachment/ticket/27802/27802.diff
 27802.diff] does. This could (?) cause some issues with counts being off,
 though it seems like the original issue would still be present.

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


More information about the wp-trac mailing list