Uploader: Route plupload errors to the correct handler and prevent naming conflicts. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
46020c6dd0
commit
095093e390
|
@ -211,19 +211,19 @@ window.wp = window.wp || {};
|
||||||
self.success( file.attachment );
|
self.success( file.attachment );
|
||||||
});
|
});
|
||||||
|
|
||||||
this.uploader.bind( 'Error', function( up, error ) {
|
this.uploader.bind( 'Error', function( up, pluploadError ) {
|
||||||
var message = pluploadL10n.default_error,
|
var message = pluploadL10n.default_error,
|
||||||
key;
|
key;
|
||||||
|
|
||||||
// Check for plupload errors.
|
// Check for plupload errors.
|
||||||
for ( key in Uploader.errorMap ) {
|
for ( key in Uploader.errorMap ) {
|
||||||
if ( error.code === plupload[ key ] ) {
|
if ( pluploadError.code === plupload[ key ] ) {
|
||||||
message = Uploader.errorMap[ key ];
|
message = Uploader.errorMap[ key ];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.error( message, error, error.file );
|
error( message, pluploadError, pluploadError.file );
|
||||||
up.refresh();
|
up.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue