Last modified: 2014-03-10 11:10:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 48581 - refactor upload code a bit for use with extensions
refactor upload code a bit for use with extensions
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: code_quality
  Show dependency treegraph
Reported: 2013-05-17 17:42 UTC by Lee Worden
Modified: 2014-03-10 11:10 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Lee Worden 2013-05-17 17:42:46 UTC
I'm thinking of developing a new version of Extension:MultiUpload and using it as a base for a more specialized upload interface for another extension's use.  All this (including the current MultiUpload) would work better if there were more of a distinction in the code between the Special:Upload page and its HTTP request, and a single file-upload operation, since you need that distinction in order to do multiple file uploads in a single request.

I'd like to split up a few functions in SpecialUpload.php, upload.js, and UploadBase.php, so that they don't assume a single upload per page view and can be called more flexibly.  I'm working on a prototype, which I'll put into Gerrit when it's more ready.

I'm opening this bug now in case people want to discuss it.
Comment 1 Andre Klapper 2013-05-24 14:51:02 UTC
Mentioning it in a thread on might be good.
Comment 2 Bawolff (Brian Wolff) 2013-05-24 19:08:12 UTC
I agree that the upload classes could be refactored (in particular trying to fix bug 48306 revealed some weaknesseses with the current design)
Comment 3 Lee Worden 2013-05-24 20:12:32 UTC
Sure.  I probably won't touch those parts.  I think a MultiUpload page - that is, an interface like Special:Upload but with several copies of the upload-file interface on a single page - can be done using a SpecialPage object that derives from SpecialUpload and a list of objects of SpecialUploadOneFile class that also derives from SpecialUpload - if some of SpecialUpload's functions are split so they can be selectively replaced in the subclasses.  This is a kind of odd design, but would allow it to use Special:Upload's code with almost no duplication while making minimal changes to MW core.  Some similar splitting would also need to happen in the javascript, and a more general factory function for UploadBase.
Comment 4 Andre Klapper 2014-03-10 11:10:21 UTC

Note You need to log in before you can comment on or make changes to this bug.