Jump to content

Module talk:Parameter validation

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ProcrastinatingReader (talk | contribs) at 15:03, 23 October 2020 (done 1 & 3). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Module improvements

Following up from Template_talk:Infobox_station#Parameter_validation:

  1. Userspace: No, perhaps not. Depends entirely on the template, but for infoboxes I suppose that may be correct. Editors may use a infobox on their main userpage though. Should that be categorised, if they're using invalid params? The module has flexibility to allow templates to do as they choose, so it's mostly a question of what's the sane default.
    • However, it is worth noting that bots may use these categories for maintenance work. Bots can be approved for non-articlespace work. And it's generally more performant to have them look over a precise category of params, than go through all transclusions or have to setup temporary cats for each run.
  2. Hmm, yes, that would be a good idea. I will see what I can do.
  3. The config page doesn't currently have knowledge of the number of entries in the list, which lies in the module. We can do "unknown parameter(s)"?

ProcrastinatingReader (talk) 23:18, 22 October 2020 (UTC)[reply]

  1. The standard Module:Check for unknown parameters allows for the use of {{main other}} to limit application of categories, while always showing the error message in preview mode. That way, a user-space or draft-space editor could see the red error message and fix their draft, but regular editors would not be bothered by user/draft-space pages cluttering up a maintenance category for actual encyclopedia articles. This module should provide that same capability in some form. If editors of a specific template want to expand categorization to other namespaces, they can do so, and then bots can do their work. The choice should be available to template editors.
  2. OK to trying to show both duplicated parameters. Something like "duplicate parameters: image/imagename, caption/image_caption" should work (that's two sets of duplicates in one message, to be clear).
  3. "unknown parameter(s)"/"deprecated parameter(s)" is a reasonable workaround. "duplicate parameters" will always be plural, since there are at least two. – Jonesey95 (talk) 23:35, 22 October 2020 (UTC)[reply]
1) Set {{main other}} as default for categorisation. Template editors can create custom configs for use and use them via parameter 3. This is documented in the module config ("JSON-encoded string" / "Template:PV default options" part). It would seemingly be quite rare for infoboxes to deviate from the default, though.
3) Done

ProcrastinatingReader (talk) 15:03, 23 October 2020 (UTC)[reply]