Last modified: 2011-04-14 15:12:16 UTC
Hi, first of all, apologies if this is a duplicate report, but I haven't been able to find a previous report for this bug. I just noticed something slightly odd about the way templates with parameters with default values are handled by {{subst:}} - it seems that when the template's contents are put into the page text, parameters that are not specified but which do have a default value are not replaced. The effect of this can be seen with [[en:Template:Unsigned]], used at the URL given above with '{{subst:Unsigned|Rpgaction}}', for example: observe that the unspecified second parameter ('{{{2|}}}') is literally copied into the page text. This does not make any real difference here, but MediaWiki should copy the parameter's default value in this case instead.
Also neither {{{<includeonly>subst:</includeonly>param|default}}} nor {{{{{{subst|}}}param|default}}} work to solve this. (result: {{{subst:param|default}}} in wikitext.
(In reply to comment #0) > I just noticed something slightly odd about the way templates with parameters > with default values are handled by {{subst:}} - it seems that when the > template's contents are put into the page text, parameters that are not > specified but which do have a default value are not replaced. This request is pretty much bug 2777. Substing copies the text of the target exactly, it doesn't subst anything that's transcluded there. (In reply to comment #1) > Also neither {{{<includeonly>subst:</includeonly>param|default}}} nor > {{{{{{subst|}}}param|default}}} work to solve this. (result: > {{{subst:param|default}}} in wikitext. Confirmed (look at wikitext of [[User:Simetrical/6305b]]). To clarify, "subst:" is nonfunctional for variables, period. I'm changing the summary accordingly, and refiling as enhancement because that isn't strictly speaking a bug.
I found a similar bug. Maybee it's the same. For example, I created a template called "Negative" which calculates something. The source of this template is {{<includeonly>subst:</includeonly>#expr: -{{{1}}} }} for example. Usage: {{subst:Negative|7}} Result: -7 Usage: {{Negative|7}} Result: {{subst:#expr: -{{{1}}} }} This is very strange and completely useless, obviously. The expected result is {{Negative|7}}.
Is this a duplicate of bug #5453?