r85683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85682‎ | r85683 | r85684 >
Date:18:43, 8 April 2011
Author:neilk
Status:deferred
Tags:
Comment:
fix bug 28320 - use a semi-random filename for stashed upload, so we never trigger same-filename error, but we *do* trigger same-content errors
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -306,7 +306,12 @@
307307 return;
308308 }
309309
310 - $j( _this.filenameCtrl ).val( _this.upload.title.getMain() );
 310+ // Set the filename we tell to the API to be the current timestamp + the filename
 311+ // This is because we don't actually care what the filename is at this point, we just want it to be unique for this session and have the
 312+ // proper file extension.
 313+ // Also, it avoids a problem -- the API only returns one error at a time and it thinks that the same-filename error is more important than same-content.
 314+ // But for UploadWizard, at this stage, it's the reverse. We want to stop same-content dead, but for now we ignore same-filename
 315+ $j( _this.filenameCtrl ).val( ( new Date() ).getTime().toString() +_this.upload.title.getMain() );
311316
312317 if ( ! _this.isFilled ) {
313318 var $div = $j( _this.div );

Status & tagging log