Page MenuHomePhabricator

Proposal for more sophisticated "required" parameter option
Open, Needs TriagePublic

Description

I have been wondering whether it would be possible to add support in TemplateData for a more versatile required/deprecated/suggested designation of parameters. A discussion has been started at https://en.wikipedia.org/wiki/Wikipedia_talk:TemplateData#Add_support_for_more_sophisticated_%22required%22_options

There are many cases in which whether a parameter should be marked as required depends on whether certain other parameters are used or whether certain inputs are entered in those parameters. Likewise, the same can be said for deprecated parameters. Is this technically feasible?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 18 2018, 10:33 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJun 18 2018, 10:35 PM
Aklapper updated the task description. (Show Details)Jun 19 2018, 5:04 AM

This seems like a duplicate of T192385: Support for conditional parameters in TemplateData, and others. Such tasks are technically feasible, but there is currently no active development taking place on TemplateData.

Mvolz added a subscriber: Mvolz.Jun 19 2018, 7:01 PM

At least part of this seems doable, i.e. have something like this:

		"archive-url": {
			"label": "Archive URL",
			"description": "The URL of an archived copy of a web page, if or in case the URL becomes unavailable; requires 'archivedate'",
			"type": "line",
			"aliases": [
				"archiveurl"
			],
			"requires": [
				"archive-date"
			],
		},

The "requires" could be used for the dependency case, where using one parameter requires the use of another parameter.

But for the use case mentioned in the thread on en wiki, I'm not quite sure how that would be modelled. Specific examples might help conceptualise that.

Vvjjkkii renamed this task from Proposal for more sophisticated "required" parameter option to hpaaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
Mvolz renamed this task from hpaaaaaaaa to Proposal for more sophisticated "required" parameter option.Jul 1 2018, 8:57 AM
Mvolz lowered the priority of this task from High to Normal.
Mvolz updated the task description. (Show Details)
Mvolz lowered the priority of this task from Normal to Low.Jul 1 2018, 9:04 AM
CommunityTechBot raised the priority of this task from Low to Needs Triage.Jul 5 2018, 7:02 PM