Last modified: 2014-09-04 09:59:26 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 T52407, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50407 - TemplateData: Add a way to express dependencies between parameters
TemplateData: Add a way to express dependencies between parameters
Status: ASSIGNED
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks: 53469
  Show dependency treegraph
 
Reported: 2013-06-29 00:00 UTC by Carl Fürstenberg
Modified: 2014-09-04 09:59 UTC (History)
9 users (show)

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


Attachments

Description Carl Fürstenberg 2013-06-29 00:00:12 UTC
Add a way to mark a parameter to be dependent on an other paramter. For example :
We have following parameters:
"foo1_bar", "foo1_baz", "foo1_quux" 
...
 "fooN_bar", "fooN_baz", "fooN_quux"

fooX_bar required fooX_baz to be used as well, it doesn't require fooX_quux to be used, but if fooX_quux is used, then fooX_bar must have been defined as well
Comment 1 Helder 2013-06-30 10:54:52 UTC
See also [[User:קיפודנחש/TemplateParamWizard#Depends on]].
Comment 2 Gerrit Notification Bot 2013-07-14 19:41:26 UTC
Change 73708 had a related patch set uploaded by AzaToth:
Add depends and conflicts parameters

https://gerrit.wikimedia.org/r/73708
Comment 3 Krinkle 2013-07-15 18:20:31 UTC
Note that as for a parameter "going together with" other parameters, this is what a "Set" is for.

Though Sets are merely suggestive and allow for overlap, it us a lot easier to work with from a user interface perspective.

Though TemplateData is generic and should not be tailored specific for VisualEditor, right now I'd recommend we hold off on this change until we find out and/or verify that this can be properly represented in a user interface without making it too complex.
Comment 4 Carl Fürstenberg 2013-07-15 18:29:19 UTC
(In reply to comment #3)
> Note that as for a parameter "going together with" other parameters, this is
> what a "Set" is for.
> 
> Though Sets are merely suggestive and allow for overlap, it us a lot easier
> to
> work with from a user interface perspective.
Set doesn't make any sense for parameters like "author1, author2, ..., authorN"
> 
> Though TemplateData is generic and should not be tailored specific for
> VisualEditor, right now I'd recommend we hold off on this change until we
> find
"depends" and "conflicts" are pretty much not tailored for VE at all (Though I could agree, sets are).
> out and/or verify that this can be properly represented in a user interface
> without making it too complex.
The most important thing is that common templates can be modeled correctly without ending up with too many false choices, or hiding true choices because they couldn't be modeled correctly.
Comment 5 Chris McKenna 2013-08-28 11:33:11 UTC
at en.wp a user has given the example of [[template:for]] where parameter 3 is optional unless parameter 4 is specified, when it becomes mandatory.

They expected that VisualEditor would give them a warning about using parameter 4 without parameter 3. Obviously this is not possible until TemplateData can define such relationships.
Comment 6 Gerrit Notification Bot 2014-07-09 21:48:58 UTC
Change 73708 abandoned by Krinkle:
Add depends and conflicts parameters

Reason:
Closing for now to clear review backlog. Can be re-activated when the feature request is accepted.

https://gerrit.wikimedia.org/r/73708
Comment 7 James Forrester 2014-09-03 21:02:53 UTC
[Moved from bug 60358 discussion.]

(In reply to Helder from bug 60358 comment #10)
> (In reply to James Forrester from bug 60358 comment #9)
> > (In reply to Helder from bug 60358 comment #8)
> > > (In reply to James Forrester from bug 60358 comment #6)
> > > > (In reply to Ricordisamoa from bug 60358 comment #5)
> > > > > or a set of fields may be mutually exclusive (and yet one of them would
> > > > > be required).
> > > > 
> > > > That doesn't make sense. "Required" means "the template will die horribly if
> > > > you don't include this". It is *not* a "we'd like you to fill this in" –
> > > > that's what "suggested" is for. Most templates will have no 'required'
> > > > fields.
> > > 
> > > It seems perfectly valid for a template to require that "either A or B be
> > > provided" and the user should be able to delete one of them if it is not
> > > needed.
> > 
> > This feels like a pretty edge case (and suggests that we should consider
> > whether the template should be re-written to be less anti-human); maybe file
> > a TemplateData bug to ask for a way to express this relationship?
> 
> This kind of relationship between parameters was requested on bug 50407.

Well, as I see it, this bug only asks for param-level relationships – if A also B; if C not D; etc.

Should we extend it for shared-param relationships (exactly one of A, B and C are required; D is an alias for E if F is set but is an alias for G if F is not set; …), or should we create a new bug? (BTW, this feels like a potentially ever-expanding system could be created, and we'd probably say this adds too much complexity for the value.)

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


Navigation
Links