Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#29891 closed defect (bug) (fixed)

Display error message when Media Library upload fails

Reported by: aduth Owned by: wonderboymusic
Priority: normal Milestone: 4.1
Component: Media Version: 4.1
Severity: normal Keywords: has-patch commit
Cc: Focuses: ui, javascript

Description

Currently, when an upload fails in the media library, the following message is displayed:

An error occurred in the upload. Please try again later.

Behind the scenes, more useful error messages are set into the failure response, but they're not being exposed to the user. For example, /wp-admin/includes/ms.php returns error messages related to unavailable disk space, but only the message above is displayed.

Attached is a patch to display the error response to the user alongside the generic error message above.

Attachments (3)

show-upload-errors.diff (1.1 KB ) - added by aduth 12 years ago.
Patch to display error response on a failed upload
29891-01.patch (678 bytes ) - added by gcorne 12 years ago.
29891.2.diff (713 bytes ) - added by TobiasBg 12 years ago.

Download all attachments as: .zip

Change History (9)

@aduth
12 years ago

Patch to display error response on a failed upload

#1 @kpdesign
12 years ago

  • Keywords has-patch added

@gcorne
12 years ago

#2 @gcorne
12 years ago

  • Keywords commit added
  • Milestone Awaiting Review4.1
  • Type enhancementdefect (bug)

I think that a cleaner solution (see 29891-01.patch} to this issue is to bypass calling wp_die() if during an ajax request. By not calling wp_die() the errors will flow through to wp_ajax_upload_attachment where they will result in an error JSON response.

#3 @gcorne
12 years ago

Related to #25849

#4 @wonderboymusic
12 years ago

  • Owner set to wonderboymusic
  • Resolutionfixed
  • Status newclosed

In 30156:

Display error message when Media Library upload fails.

Props gcorne.
Fixes #29891.

#5 @TobiasBg
12 years ago

  • Resolution fixed
  • Status closedreopened

Let's use ! DOING_AJAX as we do everywhere else, see 29891.2.diff.

@TobiasBg
12 years ago

#6 @jeremyfelt
12 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 30177:

Use common core syntax for checking DOING_AJAX

Our current check for a non truthy DOING_AJAX is ! DOING_AJAX.

props TobiasBg
Fixes #29891

Note: See TracTickets for help on using tickets.