WordPress.org

Make WordPress Core

#23317 closed defect (bug) (fixed)

Featured Image able to be set before image processed

Reported by: bobbravo2 Owned by: markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.5.1
Component: Media Keywords: has-patch needs-testing
Focuses: Cc:

Description

Steps to reproduce:

  • Click set featured image
  • Upload new (larger) file
  • Click set featured image before the image has been resized.

The media modal show a blank square upon reopening the dialog: http://cl.ly/image/2h3R30432J2u

In addition, the featured image interface breaks until the page is reloaded. To confirm, after seeing the blank media box as pictured, try setting the featured image again.

Tested on 3.6-alpha-23334 with WP_DEBUG && SCRIPT_DEBUG set to true

Attachments (3)

featured_image_blank_box.PNG (102.8 KB) - added by ew_holmes 15 months ago.
Screenshot of the result.
media-views.diff (663 bytes) - added by kadamwhite 14 months ago.
Patch to prevent submission of media frame if any selected attachment is still uploading
media-views.2.diff (626 bytes) - added by kadamwhite 12 months ago.
Flipped operands of === per georgestephanis

Download all attachments as: .zip

Change History (12)

comment:1 nacin15 months ago

  • Cc koopersmith added
  • Milestone changed from Awaiting Review to 3.5.2
  • Version set to 3.5.1

Is this reproducible in 3.5.0? I am guessing not.

comment:2 ew_holmes15 months ago

  • Cc eric@… added
  • Keywords needs-patch added

This is reproducible in 3.5.0-RC4. Selecting "Set featured image" before the image is processed/uploaded causes the Featured image modal to close, but the featured image is not set.

Upon re-opening the featured image selection, the original image is there, along with the blank square. It disappears when the page is refreshed.

ew_holmes15 months ago

Screenshot of the result.

comment:3 kadamwhite14 months ago

  • Cc kadamwhite added

comment:4 CrazyJaco14 months ago

  • Cc CrazyJaco added

comment:5 kadamwhite14 months ago

If any attachments within the current selection have not finished uploading, then the submit button will fail in both the "Insert Media" frame and the "Set Featured Image" media frame. The extra ghost attachment item is just a side-effect of the weird state you get by trying to set the featured image when the attachment's data isn't available.

After speaking with Helen, we feel it makes sense to disable the submit button if any image within the current selection has not yet finished uploading. This will prevent the unexpected behavior of clicking the "insert" button and seeing no action, as well as preventing the creation of the empty extra Attachment model.

CrazyJaco & I have a patch for this, attached above. We are using _.map to get a list of the uploading state of all models within the collection, then identifying whether any of those uploads are still in progress with _.some.

comment:6 kadamwhite14 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

Re-uploaded the patch to remove the call to _.map, as it was completely unneeded -- you can call .get('uploading') from directly within _.some()

kadamwhite14 months ago

Patch to prevent submission of media frame if any selected attachment is still uploading

comment:7 wonderboymusic12 months ago

  • Milestone changed from 3.5.2 to 3.6

comment:8 kadamwhite12 months ago

Just tested this against latest trunk—it merges cleanly and seems to still do its job.

comment:9 markjaquith12 months ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 23956:

Don't allow images to be set as featured image until they have been processed.

props kadamwhite. fixes #23317.

kadamwhite12 months ago

Flipped operands of === per georgestephanis

Note: See TracTickets for help on using tickets.