Last modified: 2012-03-15 00:28:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35341, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33341 - Provide url parameters to prefill the fields of upload wizard
Provide url parameters to prefill the fields of upload wizard
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal normal with 3 votes (vote)
: ---
Assigned To: Jeroen De Dauw
http://lists.wikimedia.org/pipermail/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-22 23:18 UTC by Platonides
Modified: 2012-03-15 00:28 UTC (History)
12 users (show)

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


Attachments

Description Platonides 2011-12-22 23:18:02 UTC
It should be possible to provide through url parameters default values for some (all?) upload entries.

See 'Upload Wizard with prefilled ID-field' thread in wikilovesmonuments list (linked at URL), requesting specifically that the ID can be set through the url, for providing direct upload links from the lists.
Comment 1 Phil Chang 2011-12-29 21:05:58 UTC
Looking at a similar mechanism for connecting the process of uploading photos from the starting point of a Wikipedia article.
Comment 2 Jeroen De Dauw 2012-03-11 18:10:38 UTC
It is not very hard to accept url arguments for all configuration settings that can already be set via upload campaigns. This does not cover the values of ALL fields, but I sort of wonder if anything more then what the campaigns support is needed.
Comment 3 AleXXw 2012-03-11 19:42:29 UTC
@Jeroen: We want to prefill the ID-field per link iE from monumant-maps. So we need a URL-parameter to provide the ID to the upload-wizzard.
Comment 4 Andre Koopal 2012-03-11 19:54:33 UTC
I don't know what you mean with configuration settings, but the question is basically that if you define an extra field in the form, for example with WLM the monument-id, you want to be able to make a url where you can prefill that value.

Again taking WLM as an example, on the lists on wikipedia, you can imagine that if there is no picture you put a link 'upload a picture' where you then link to the WLM campaign, with the ID already prefilled, as that is already known there.

I can imagine strategies like this much wider, but this is about all the fields you define in the upload form to fill in.
Comment 5 elya 2012-03-11 19:57:38 UTC
Good news to hear that, Jeroen. Additionally to what AleXXw and Andre said, it would be nice to have as much flexibility as possible - e.g. prefilling categories, as there are countries that do not have the unique identifier and for them it would be very helpful to prefill other fields. 

Category prefilling - from my point of view - would anyway be a good perspective for uploading images directly from Wikipedia.
Comment 6 Jeroen De Dauw 2012-03-11 20:07:40 UTC
Apparently there was no option to do this yet. I added one in r113584 which can be set as part of upload campaigns, or be overridden using the "id" url parameter, ie &url=42.
Comment 7 AleXXw 2012-03-11 20:15:09 UTC
Does in mean we can use "http://commons.wikimedia.org/w/index.php?title=Special:UploadWizard&uselang=de&campaign=wlm-at&url=12345" to prefill the ID-field in step 4? If yes: great start, but it just helps some countries ;) (see elya) It would be great to also be able to prefill description, coordinates, categories...
Comment 8 Jeroen De Dauw 2012-03-11 21:43:41 UTC
There is no magic solution to simply support all fields. It is very easy to url param support or upload campaign support for the existing settings, but like I already noted, these don't include initial values for all fields.

I added support for setting initial value of description, coordinates and categories fields via both url args and upload campaigns in r113591

The url args are:
* id
* description
* lat
* lon
* alt
* categories (the value is either a single category name or several separated using |, such as categories=Foo|Bar)

Is that sufficient?
Comment 9 Andre Koopal 2012-03-11 21:47:23 UTC
Can't you do something like &field=<name:value>;... or instead of a ; separated list, make it possible to use field multiple time?
Comment 10 Jeroen De Dauw 2012-03-11 22:09:15 UTC
(In reply to comment #9)
> Can't you do something like &field=<name:value>;... or instead of a ; separated
> list, make it possible to use field multiple time?

Sorry, I don't understand what you are getting at. Where is semicolon used as separator?? And why would you want to put stuff in a single url arg with some weird syntax? Seems like asking for problems for no benefit at all...
Comment 11 Andre Koopal 2012-03-11 22:16:50 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > Can't you do something like &field=<name:value>;... or instead of a ; separated
> > list, make it possible to use field multiple time?
> 
> Sorry, I don't understand what you are getting at. Where is semicolon used as
> separator?? And why would you want to put stuff in a single url arg with some
> weird syntax? Seems like asking for problems for no benefit at all...

The semicolon is used as separator if you want to prefill more fields. I am just trying to think along to have a generic way to prefill any field you can.

And indeed, I see the problem in making a long variable, I don't know the language and methods behind this, so I don't know if having duplicate parameters is easy. So that is why I mentioned both.

But the proposal is that say you have a campaign were you have a field country and a field id, which you both want to prefill, you can either say:

&field=id:12345;country:nl

or

&field=id:12345&field=country:nl

Hope this makes it more clear.
Comment 12 Platonides 2012-03-11 22:57:12 UTC
Andre, it'd be more appropiate to have &defaultid=12345&defaultcountry=nl (I'm using 'default' as prefix to avoid colliding with existing parameters, such as title)
But I think Jeroen mentioned that it can't be done in a loop for any thinkable parameter (which would be the cool thing to do). So the discussion about the most appropiate url schema would be moot.
Comment 13 Andre Koopal 2012-03-11 23:04:37 UTC
You don't have to loop over all possible parameters, you should loop over all parameters given in the url, check if it is indeed a field in the campaign, and if so prefill it, that seems more doable to me.

But of course, I don't know the code, and Jeroen is in a better position to judge, I just try to brainstorm along, of course also because I see this functionality as a 'should have'.
Comment 14 Jeroen De Dauw 2012-03-11 23:11:55 UTC
I'd rather to with prefixes in the param names then having a single param holding all the stuff.

> you should loop over all parameters given in the url, check if it is indeed a field in the campaign

It's not quite as simple as seeing if it's there and setting it. Some parameters require some handling, such as splitting them into a list, and all of them benefit a lot from having their name mapped since the internal names are not meant for usage in urls (they are a bit long for that). So right now there is a list of url args that maps to the internal names. Since we have this list, it's easy to avoid name collisions so I'd say we do not need any prefixing at this point.

So I could add url args for all campaign args and figure out sane url arg names for all of those. Do we really need/want this though?
Comment 15 elya 2012-03-13 06:50:39 UTC
Thanks Jeroen! I will forward this news to the WLM community and let them test it - let's see how it works (e.g. with multiple upload etc.)  and if it's what most of the people want. I'm sure they will discover multiple ideas to use this new option.
Comment 16 Jeroen De Dauw 2012-03-15 00:28:25 UTC
Great, closing the bug in that case. Please create a new one if more stuff needs to be added :)

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


Navigation
Links