Page MenuHomePhabricator

Positional parameters override numbered parameters
Open, LowPublicFeature

Description

Author: conrad.irwin

Description:
This is very unexpected behaviour:

{{template|1=e=mc²|Einstein}} renders like {{template|1=Einstein}},

I would expect it to be equivalent to render like {{template|1=e=mc²|2=Einstein}} (and {{template|{{{|e=mc²}}}|2=Einstein}}, {{template|2=Einstein|{{{|e=mc²}}}}})


Version: unspecified
Severity: enhancement

Details

Reference
bz22686

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:10 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz22686.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 23853 has been marked as a duplicate of this bug. ***

Potentially useful link and example from bug 23853, which was marked as duplicate of this one:

[[meta:Help:Template#Mix of named and unnamed parameters]] explains this
problem. The last sentence is particularly relevant: "the direct assignment of
the value '1' to parameter 3 is later overwritten by the third unnamed
parameter."

For instance, if you write {{example template|3=A|B|1=C|D|E}}, and the template
consists simply of {{{1}}}-{{{2}}}-{{{3}}}, the result would be C-D-E rather
than the more logical C-B-A (where the "first" unnamed parameter, B, takes the
place of the first unassigned numbered parameter) or C-D-A (where simply
explicitly numbered parameters take precedence over the implicit numbering).

I think the first alternative, C-B-A, makes most sense, but either approach
would be better than the current behavior.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM
Aklapper removed a subscriber: wikibugs-l-list.