Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#29891 closed defect (bug) (fixed)

Display error message when Media Library upload fails

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

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 10 years ago.
Patch to display error response on a failed upload
29891-01.patch (678 bytes) - added by gcorne 10 years ago.
29891.2.diff (713 bytes) - added by TobiasBg 10 years ago.

Download all attachments as: .zip

Change History (9)

@aduth
10 years ago

Patch to display error response on a failed upload

#1 @kpdesign
10 years ago

  • Keywords has-patch added

@gcorne
10 years ago

#2 @gcorne
10 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.1
  • Type changed from enhancement to defect (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
10 years ago

Related to #25849

#4 @wonderboymusic
10 years ago

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

In 30156:

Display error message when Media Library upload fails.

Props gcorne.
Fixes #29891.

#5 @TobiasBg
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

@TobiasBg
10 years ago

#6 @jeremyfelt
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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.