Last modified: 2013-07-09 22:21:19 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 T53074, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51074 - TemplateData should include enumeration type
TemplateData should include enumeration type
Status: RESOLVED DUPLICATE of bug 50760
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-09 22:06 UTC by kwwilliams
Modified: 2013-07-09 22:21 UTC (History)
5 users (show)

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


Attachments

Description kwwilliams 2013-07-09 22:06:32 UTC
A lot of templates have arguments that are effectively enumeration types. Using the singlechart template from English Wikipedia as an example, the first argument has a limited range of actual values: things like UKrock, UKdance, UKdownload, Billboardhot100, etc. The template is structured as a switch statement that only does anything useful if it recognises the chart name. Otherwise, it just spits out a big red error message. 

It would be good if I could encode that in the template data, something like


    "1": 
     {
      "label": "Chart identifier",
      "description": "Chart name: recognized values are listed at",
      "type": "enum",
      "values":
        {
         "UKrock", "UKdance", "UKdownload", "Billboardhot100"
        }
      "required": true
     }

The template edit should then not allow freeform text entry while entering the template. Instead, it should provide a menu selection that only allows the editor to enter one of the recognized values.
Comment 1 James Forrester 2013-07-09 22:21:19 UTC
This is pretty-much entirely covered by bug 50760 - will merge and move your comment there.

*** This bug has been marked as a duplicate of bug 50760 ***

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


Navigation
Links