Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#23317 closed defect (bug) (fixed)

Featured Image able to be set before image processed

Reported by: bobbravo2's profile bobbravo2 Owned by: markjaquith's profile 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 12 years ago.
Screenshot of the result.
media-views.diff (663 bytes) - added by kadamwhite 12 years ago.
Patch to prevent submission of media frame if any selected attachment is still uploading
media-views.2.diff (626 bytes) - added by kadamwhite 11 years ago.
Flipped operands of === per georgestephanis

Download all attachments as: .zip

Change History (12)

#1 @nacin
12 years 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.

#2 @ew_holmes
12 years 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_holmes
12 years ago

Screenshot of the result.

#3 @kadamwhite
12 years ago

  • Cc kadamwhite added

#4 @CrazyJaco
12 years ago

  • Cc CrazyJaco added

#5 @kadamwhite
12 years 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.

#6 @kadamwhite
12 years 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()

@kadamwhite
12 years ago

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

#7 @wonderboymusic
11 years ago

  • Milestone changed from 3.5.2 to 3.6

#8 @kadamwhite
11 years ago

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

#9 @markjaquith
11 years 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.

@kadamwhite
11 years ago

Flipped operands of === per georgestephanis

Note: See TracTickets for help on using tickets.