Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#18723 closed defect (bug) (fixed)

Image Editing does not handle failures gracefully

Reported by: westi's profile westi Owned by: azaozz's profile azaozz
Milestone: 3.3 Priority: normal
Severity: major Version: 3.2
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

The Image Editing tools in the admin do not handle failures gracefully.

For example if loading an image / rotating and image fails and returns a failure instead of an image you end up with a spinning wheel of failure.

To reproduce:

  • Upload an image
  • Choose to edit it to get to the crop, rotate, resize options.
  • Edit 'stream_preview_image' in 'wp-admin/includes/image-edit.php' to always return false.
  • Now try an rotation. Notice the spinner never stops spinning.

This is because the javascript doesn't register an 'error' handler on the img but only a load handler so when WP fails to return an image we don't handle the error gracefully.

Change History (2)

#1 @westi
14 years ago

We need at least something like:

		img.error( function() {
			alert( 'Sorry, something went wrong.' );
			t.toggleEditor(postid, 0);
		} )

in refreshEditor

#2 @azaozz
14 years ago

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

In [18798]:

Add error message when loading the preview image in the image editor fails, fixes #18723

Note: See TracTickets for help on using tickets.