Last modified: 2014-09-25 22:04:18 UTC
TemplateData makes it possible to have 'required' parameters, but not using these parameters in the Template editor, does not alert you of the fact that these parameters are required.
Indeed, this seems like a low hanging fruit improvement - when inserting a new template, having all the required fields immediately be ready for use would significantly speed up template completion.
Change 73136 had a related patch set uploaded by Jforrester: Auto-add required params for user added templates https://gerrit.wikimedia.org/r/73136
(In reply to comment #2) > Change 73136 had a related patch set uploaded by Jforrester: > Auto-add required params for user added templates > > https://gerrit.wikimedia.org/r/73136 This just adds the parameters, not "enforcing" their presence. Not sure if we should do that (or let users do what they want). Another improvement under this bug will be to indicate mandatory ones in the list of available parameters on the template. (Put them at the top? Highlight them? Icon? …)
Leaving at "recommend" for now since we can't fully ensure that requiring all parameters is consistently the desired behavior.
Change 73136 merged by jenkins-bot: Auto-add required params for user added templates https://gerrit.wikimedia.org/r/73136
*** Bug 51186 has been marked as a duplicate of this bug. ***
English Wikipedian Joe Decker recommends indicating required parameters perhaps with the standard red asterisk.
This topic came up in http://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback#Duplicate_parameters_in_a_template and John Broughton came up with the idea that you really want more types of status: "required" - must be set, "suggested" - appears automatically on the lhs, and "optional". I'd possibly add a "not recommended" for parameters which are there to cover corner cases but you really don't want the user to enter, the color parameter in the Taxobox is such a case. Its only useful for subtemplate calling taxobox and should almost never be used in an article, but it needs to be documented. BTW Taxobox http://en.wikipedia.org/wiki/Taxobox is a nice torture test. It has over 100 parameter, most will not need to be used, but there will be an article using each. Perhaphs 10 of these are the most likely to be used which could be marked as "suggested".
Indeed, I gave up doing this for the Portuguese version for now: https://pt.wikipedia.org/wiki/Template:Info/Taxonomia?uselang=en
Should there be "not recommended" parameters (I'd suggest something like "for experts only" as a label; if something is "not recommended", why have it at all?) should be marked as such by a label, when listed as parameters that *could* be added. More generally, I don't think we need to worry much about really complex templates, if (as suggested elsewhere) the template dialog box includes a link to the documentation page for such templates. We don't need to worry much because only editors who are really interested - and motivated to understand the template - are likely to go beyond the parameters that are required and suggested, with the possible exception of editors who (idiosyncratically) use a less common parameter on a regular basis. In short, a "required" and a "suggested" list (AND enforcing that the "required" list be filled in) would be a huge win for the occasional user of templates.
Not enforcing mandatory params is a bug in either design or implementation.
I don't see why Wikipedia communities can't be trusted to decide what is *mandatory* and what is not, for template parameters. The communities are, after all, the ones who will live with the consequences of over-specifying or under-specifying such parameters. It seems a bit paternalistic for the WMF to tell these communities that whether or not they want the software to help ensure that "required" parameters are non-blank, that's not going to happen - that WMF considers anything "required" to actually be just "recommended". As an absolute minimum, VE should issue a warning when a "required" parameter is left blank.
I haven't tested required/optional fields in depth, but some casual tests suggest that currently * Required and optional parameters are presented differently. The required can be seen in a left column, while the optional are in the "body". Not the most self-evident UX if you ask me (why not adding labels "Required" / "Optional"?), but you get the idea after filling the first templates. * Required field aren't still enforced, nor there is any warning when they are left empty. My expectation as an editor is that a field marked as "required" in the documentation it is actually required...
Is there anything left here to do that isn't bug 60358?
(In reply to Alex Monk from comment #14) > Is there anything left here to do that isn't bug 60358? I believe that that will complete this.
I just used the Cite news template in VE, via the mini-editor. That template has a number of "required" parameters. I added just a url (a non-required field), clicked "Insert citation", and the dialog closed, posting the citation to the main page. I also tested the Infobox person template, which uses the regular Template dialog. That template has one required parameter, "Name". I ignored that parameter, added another one, filled in the second one, and clicked "Insert template"; the dialog box closed. And the inserted template did *not* have a value for the one required parameter. So not only are "required" parameters not enforced by VE, but VE doesn't even *warn* the user that one or more required parameters are missing. That is quite unhelpful; it's a missed opportunity for VE to be *better* than the wikitext editor. (I note, in passing, that the marking of "required" fields is, let's say, *subtle* - an uncolored asterisk that doesn't have a tooltip. I hope that subtlety isn't one of the goals of the VE team.) At minimum, VE should display a warning (pop-up box) that says "One or more required parameters is missing". Then the user could choose either to click on "return to dialog" or click on "insert citation"; the latter would finish the dialog. And NO, Bug 60358 does not address *anything* about the templates creation process (as described above). Bug 60358 is about *editing* an existing template, which is a different thing.
We're also going to require the user to confirm when they try to insert a template with required parameters missing.
Change 156559 had a related patch set uploaded by Alex Monk: Get confirmation when trying to insert template with required parameters missing https://gerrit.wikimedia.org/r/156559
Change 156559 merged by jenkins-bot: Get confirmation when trying to insert/edit template/citation with required parameters missing https://gerrit.wikimedia.org/r/156559
There are still some remaining improvements (as always), but the thrust of this bug is now done.
Verified the fix to show confirmation dialog when trying to insert/edit a template with one or more missing required parameters
Verified the fix in test2
Verified the fix in production