Last modified: 2011-04-14 15:12:16 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 T8305, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6305 - Subst should work for parameters
Subst should work for parameters
Status: NEW
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Low enhancement with 4 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/User:Sim...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-14 18:12 UTC by Schnee
Modified: 2011-04-14 15:12 UTC (History)
0 users

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


Attachments

Description Schnee 2006-06-14 18:12:42 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.
Comment 1 Charlie Huggard 2006-07-27 03:03:41 UTC
Also neither {{{<includeonly>subst:</includeonly>param|default}}} nor
{{{{{{subst|}}}param|default}}} work to solve this. (result:
{{{subst:param|default}}} in wikitext.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-07-27 03:13:03 UTC
(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.
Comment 3 TMg 2007-09-04 19:22:38 UTC
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}}.
Comment 4 TMg 2007-09-04 19:34:09 UTC
Is this a duplicate of bug #5453?

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


Navigation
Links