Per bug 31926 comment 5, please update this script to use ResourceLoader.
Version: unspecified
Severity: enhancement
Per bug 31926 comment 5, please update this script to use ResourceLoader.
Version: unspecified
Severity: enhancement
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Invalid | None | T33926 Updating from addOnloadHook to jQuery(document).ready breaks some scripts (tracking) | |||
Resolved | Krenair | T33946 mediawiki.legacy.upload should be migrated to a modern module |
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
I think the next steps for this bug are:
Change 158677 had a related patch set uploaded by Alex Monk:
Merge mediawiki.legacy.upload into mediawiki.special.upload
(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