Last modified: 2011-03-19 02:57:15 UTC
Uploading a file that already exists on the wiki causes the spinner to spin forever. The API request comes back with /something/ but Firebug is being a PITA and won't show me the response contents. Observed on commons.prototype.wm.o/uwd
It just so happens that mw.iFrameTransport.js line 94 uses a temporary variable called json without declaring it, which results in it leaking into the global scope. This is bad style, but allowed me to get the server's response: >>> json "{ "upload": { "result": "Warning", "warnings": { "exists": "Badtoken.png" }, "sessionkey": "frex7j7se8avvfo2pmmt5t643h10zki" } } "
Upon casual reading of the code, it looks like mw.UploadWizard.js lines 229-233 seem to be the culprit, along with a comment acknowledging the issue.
*** Bug 26007 has been marked as a duplicate of this bug. ***
I haven't looked at the code yet, but you can check if a file already exists on commons by running a hash check through the API. If ?action=query&list=allimages&aisha1=<imagehash> returns any matches, you can discard the upload and return an error message.
fixed in r84223
see above comment, fixed in r84223