Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#20445 closed defect (bug) (fixed)

UI issues for failed uploads

Reported by: trepmal's profile trepmal Owned by: azaozz's profile azaozz
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3
Component: Upload Keywords: has-patch
Focuses: Cc:

Description

When uploading a file with a forbidden extension using the multi-file uploader, the upload will (of course) fail. But the "crunching" bar remains visible, and if the Gallery tab is visible, the attachment count is wrongly incremented.

Will also happen if there are directory permission issues ('cannot write to directory', 'uploaded file could not be moved').

http://cl.ly/FqXI/bad-file-type.png

Screencast showing gallery tab incrementing: http://screencast.com/t/EJtWF2kXXBki

Although the correct error messages are sent from async-upload.php, the js (wp-includes/js/plupload/handlers.js) looks for a particular string to check if the response is an error, and this string is not present.

Patch adds the string as an easy fix.

Attachments (2)

async-upload.php.diff (744 bytes) - added by trepmal 13 years ago.
20445.patch (595 bytes) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.4

Could probably as well check for error-div in handlers.dev.js.

In 3.2, the progress bar was hidden in prepareMediaItem() (this was changed in [19346]):
http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/js/swfupload/handlers.dev.js#L48
The Gallery tab counter was still incrementing though.

#2 @azaozz
12 years ago

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

In [20580]:

Uploader: fix check for error message send from async-upload on failed uploads, improve styling it a bit, props trepmal, SergeyBiryukov, fixes #20445

Note: See TracTickets for help on using tickets.