[wp-trac] [WordPress Trac] #37658: Featured image on media files can not be changed

WordPress Trac noreply at wordpress.org
Mon Aug 15 16:55:52 UTC 2016


#37658: Featured image on media files can not be changed
--------------------------------------+------------------------------
 Reporter:  Clorith                   |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Post Thumbnails           |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  javascript
--------------------------------------+------------------------------
Changes (by flixos90):

 * keywords:  has-patch has-unit-tests needs-refresh => has-patch has-unit-
     tests


Comment:

 [attachment:37658.4.diff] fixes the failing tests.

 As discussed on Slack, the first failure was caused by the global `$post`
 not being properly set up.

 The second failure was happening because setting the post thumbnail was
 done before setting the attached file for an attachment. When inserting a
 new attachment, that was causing `wp_attachment_is()` to return false
 because no file was set at that point. It wouldn't have affected existing
 attachments, but now it's fixed for inserting new ones as well, by moving
 the post thumbnail block below setting the attached file.

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


More information about the wp-trac mailing list