Page MenuHomePhabricator

mediawiki.legacy.upload should be migrated to a modern module
Closed, ResolvedPublic

Description

Per bug 31926 comment 5, please update this script to use ResourceLoader.


Version: unspecified
Severity: enhancement

Details

Reference
bz31946

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:54 PM
bzimport set Reference to bz31946.

Just a question: do we still need the AJAX destination filename check now that we have the upload stash?

Converting the check to use the API in a sensible manner has proven to be quite a challenge, and I suppose that's why it hasn't been done yet. Unlike SpecialUpload::ajaxGetExistsWarning(), API modules return error codes and not messages in the user's language.

I suppose I could add a "warnings only" mode to the upload API, which would not require uploading an actual file. Then, if it returns an error or warning code, the script could make a second API request for the actual message text. There ought to be a better way to load fully parsed messages such as https://commons.wikimedia.org/wiki/MediaWiki:Fileexists though.

(In reply to comment #1)

... API modules return error codes and not
messages in the user's language.

Bug 35074?

Unassigning from myself. I am not currently working on this because of the aforementioned limitation of the MW API.

(In reply to Kevin Israel (PleaseStand) from comment #1)

Just a question: do we still need the AJAX destination filename check now
that we have the upload stash?

Converting the check to use the API in a sensible manner has proven to be
quite a challenge, and I suppose that's why it hasn't been done yet. Unlike
SpecialUpload::ajaxGetExistsWarning(), API modules return error codes and
not messages in the user's language.

I suppose I could add a "warnings only" mode to the upload API, which would
not require uploading an actual file. Then, if it returns an error or
warning code, the script could make a second API request for the actual
message text. There ought to be a better way to load fully parsed messages
such as https://commons.wikimedia.org/wiki/MediaWiki:Fileexists though.

I moved that stuff to the API in Gerrit change 65641

Change 156552 had a related patch set uploaded by Alex Monk:
Clean up mediawiki.legacy.upload a bit more

https://gerrit.wikimedia.org/r/156552

Change 156552 merged by jenkins-bot:
Clean up mediawiki.legacy.upload a bit more

https://gerrit.wikimedia.org/r/156552

I think the next steps for this bug are:

  • Merging the code into mediawiki.special.upload
  • Considering what variables we expose globally (maybe moving some stuff under mw.)

Change 158677 had a related patch set uploaded by Alex Monk:
Merge mediawiki.legacy.upload into mediawiki.special.upload

https://gerrit.wikimedia.org/r/158677

(In reply to Alex Monk from comment #7)

  • Merging the code into mediawiki.special.upload

This is done.

(In reply to Alex Monk from comment #7)

  • Considering what variables we expose globally (maybe moving some stuff

under mw.)

Actually I think that is kind of out of the scope of this bug. Closing as fixed.

Change 158677 merged by jenkins-bot:
Merge mediawiki.legacy.upload into mediawiki.special.upload

https://gerrit.wikimedia.org/r/158677

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:20 AM