Provide url parameters to prefill the fields of upload wizard
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: normal
URL: http://lists.wikimedia.org/pipermail/wikilovesmonuments/2011-December/thread.html#2275

bzimport set Reference to bz33341.
Platonides created this task.Via LegacyDec 22 2011, 11:18 PM
bzimport added a comment.Via ConduitDec 29 2011, 9:05 PM

philinje wrote:

Looking at a similar mechanism for connecting the process of uploading photos from the starting point of a Wikipedia article.

JeroenDeDauw added a comment.Via ConduitMar 11 2012, 6:10 PM

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.

bzimport added a comment.Via ConduitMar 11 2012, 7:42 PM

alexxw83 wrote:

@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.

Akoopal added a comment.Via ConduitMar 11 2012, 7:54 PM

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.

bzimport added a comment.Via ConduitMar 11 2012, 7:57 PM

ew-nospam wrote:

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.

JeroenDeDauw added a comment.Via ConduitMar 11 2012, 8:07 PM

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.

bzimport added a comment.Via ConduitMar 11 2012, 8:15 PM

alexxw83 wrote:

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...

JeroenDeDauw added a comment.Via ConduitMar 11 2012, 9:43 PM

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?

Akoopal added a comment.Via ConduitMar 11 2012, 9:47 PM

Can't you do something like &field=<name:value>;... or instead of a ; separated list, make it possible to use field multiple time?

JeroenDeDauw added a comment.Via ConduitMar 11 2012, 10:09 PM

(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...

Akoopal added a comment.Via ConduitMar 11 2012, 10:16 PM

(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.

Platonides added a comment.Via ConduitMar 11 2012, 10:57 PM

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.

Akoopal added a comment.Via ConduitMar 11 2012, 11:04 PM

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'.

JeroenDeDauw added a comment.Via ConduitMar 11 2012, 11:11 PM

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?

bzimport added a comment.Via ConduitMar 13 2012, 6:50 AM

ew-nospam wrote:

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.

JeroenDeDauw added a comment.Via ConduitMar 15 2012, 12:28 AM

Great, closing the bug in that case. Please create a new one if more stuff needs to be added :)

Gilles added a project: Multimedia.Via WebDec 4 2014, 10:26 AM
Gilles raised the priority of this task from "Normal" to "Unbreak Now!".Via WebDec 4 2014, 10:29 AM
Gilles moved this task to Closed on the Multimedia workboard.
Gilles lowered the priority of this task from "Unbreak Now!" to "Normal".Via ConduitDec 4 2014, 11:22 AM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.