Last modified: 2010-04-09 00:43:50 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 T7453, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5453 - Transcluded substitutions are treated as literals (neither transcluded nor substituted)
Transcluded substitutions are treated as literals (neither transcluded nor su...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Normal normal with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Template...
: patch
: 8675 (view as bug list)
Depends on: 16714 22297
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-04 19:57 UTC by Kyle Barbour
Modified: 2010-04-09 00:43 UTC (History)
5 users (show)

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


Attachments
A proposed patch (1.24 KB, patch)
2010-01-27 02:28 UTC, Conrad Irwin
Details

Description Kyle Barbour 2006-04-04 19:57:19 UTC
When using the markup {{<includeonly>subst:</includeonly>PAGENAME}} (or any
other magic word. I've tested several and had the same results with all of 'em)
on a page, PAGENAME displays the pagename properly when viewing that page. When
that page is substed into another page, it displays properly as well. However,
when that page is displayed using a template tag (i.e. {{Template:Welcome}}),
what is shown on that page is "{{subst:PAGENAME}}" (for example, here's a
template with said <includeonly> tags: [[en:User:Blackcap/Welcome]], and here's
a page with template tags linking to that page:
[[en:User:Kusma/Sandbox#Welcome.2C_.7B.7Bsubst:PAGENAME.7D.7D.21]]). I reckon
that what should be shown  is simply what {{PAGENAME}} would normally show;
thus, the pagename.
Comment 1 Kyle Barbour 2006-04-04 20:03:24 UTC
Clarification on why I used [[en:Template:Welcome]] as the URL: the bug was
found there while trying to find a way to either subst or not subst PAGENAME on
that template. Discussion: [[en:Template talk:Welcome#PAGENAME issue]].
Comment 2 Brion Vibber 2006-04-04 20:10:18 UTC
You're breaking up the markup with other markup; that tends not to work.
Comment 3 Kyle Barbour 2006-04-04 20:23:21 UTC
Yet, the additional markup doesn't break when the template is substed. Is that
to be expected?

If it's the addition markup causing the problem, another editor
([[en:User:Kusma]]) suggested that there be an addition of <substonly> and
<nosubst> tags, with the effect that things inside them would only be shown when
the page is substed or displayed, respectively. Thus, one could deal with the
problem by using the markup "<nosubst>{{PAGENAME}}</nosubst>
<substonly>{{subst:PAGENAME}}</substonly>."
Comment 4 Melancholie 2006-04-08 19:18:30 UTC
If it won't work with <includeonly>, will it work like it was requested in bug 4484?
If yes, this bug is a duplicate of bug 4484.
Comment 5 Kyle Barbour 2006-04-09 06:58:27 UTC
It might be. If what I'm referring to is a bug with <includeonly>, then no. If
<includeonly> is intended to operate in the way it does, than yes, it would be a
duplicate, and should be marked as such.
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-07-27 03:22:52 UTC
The bug (if it can be called a bug, strictly speaking) is that transcluding a
substitution is impossible and results in the substitution being treated as a
literal.  If you transclude "{{subst:foo}}", it can't be substituted into the
transclusion, obviously, which is why I'm not sure this is really a bug. 
Desired behavior is that it be transcluded, with the "subst:" ignored.

On the other hand, until bug 4484 and/or bug 2003 are fixed, this behavior is
important to force people to subst; a number of templates on enwiki are using
this to avoid people accidentally editing a transcluded talk-page template like
[[Template:Image source]] by clicking the section edit link, and IMO it would be
unwise to take that ability away without replacing it.
Comment 7 Splarka 2009-06-24 00:35:45 UTC
*** Bug 8675 has been marked as a duplicate of this bug. ***
Comment 8 Conrad Irwin 2010-01-27 02:28:54 UTC
Created attachment 7023 [details]
A proposed patch

The patch attached adds new syntax

{{<includeonly>subst:subst:</includeonly>Template}}

now acts exactly like 

{{<includeonly>subst:</includeonly>Template}}

always should have. I.e. it expands the template even when it is being included in a template that does not get subst:d.

In other respects

{{subst:subst:Template}}

acts exactly like 

{{subst:Template}}

The alternative way to fix this would be to add a new magic word, this would, in my opinion, be less easy for editors to remember. (That said we don't seem to care much about the usability of template-wikitext).
Comment 9 Conrad Irwin 2010-02-10 14:38:40 UTC
Since safesubst: was added in r61710. You will be able to use "safesubst:" instead of "subst:" in templates that require transcluded substitution to work, while still being able to use subst: for cases where the template wants to know if it has been subst:d.

http://en.wikipedia.org/wiki/Help:Substitution#safesubst:
Comment 11 Conrad Irwin 2010-04-09 00:43:50 UTC
Sorry, this particular change was not reverted by Tim, and is in 1.16beta.

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


Navigation
Links