Page MenuHomePhabricator

<noinclude></noinclude> section is transcluded when used by system messages
Closed, ResolvedPublic

Description

Author: stanley

Description:
<noinclude></noinclude> section not included when transcluded into
MediaWiki:foo, but included when the MediaWiki:foo message used by mw in their
proper function.

for example:

  1. Template:test => sometext <noinclude>comments</noinclude>
  2. Put {{test}} to MediaWiki:Recentchangestext => sometext
  3. go to Special:recentchanges, it displayed => sometext comments

Version: 1.7.x
Severity: minor

Details

Reference
bz4926

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:06 PM
bzimport set Reference to bz4926.

robchur wrote:

*** Bug 5721 has been marked as a duplicate of this bug. ***

I've added test cases for this in r14694, but haven't made the
fix yet until we have a better idea of what needs to be done
with message transforms.

It may make the most sense to simply not do any template
transclusions in message transformation; wikitext messages will
then do the transclusion at parse time.

  • Bug 6429 has been marked as a duplicate of this bug. ***

plasmeier180 wrote:

I notice something similar and filed Bug 6429, which was marked a duplicate of
this bug. I thought I would add my experience and test cases here to see if it

could help squash this bug. Thanks

I have found that text placed in <noinclude> tags in templates will show up
anyway when transclued in the Sitenotice. See my beta wiki for an example:
http://beta.theplaz.com/index.php?title=MediaWiki:Sitenotice.

You can see in the sitenotice on every page at beta.theplaz.com that the
noinclude text got transcluded anyway.
My sitenotice calls http://beta.theplaz.com/index.php?title=Template:This_Template

When I view the regular sitenotice page (MediaWiki:Sitenotice) the text in the
noinclude does not appear. This way I know that I used the noinclude properly.
I know I am using an old version of MW, but I searched and didn't see it fixed
in 1.6.7.

-Michael
http://theplaz.com

plasmeier180 wrote:

I just noticed something else related to this bug. It seems that the problem
goes away when the content is double transcluded. As above, I have
[[Template:This Template]], I then created [[Template:Middleman]] and had that
transclude {{This Template}}. I then switched the sitenotice to transclude
{{Middleman}} instead. The text in the noinclude is no longer transcluded.
This seems to be a working work-around that editors can use to temporary resolve
this problem. Can someone confirm this for me? Thanks.

-Michael
http://theplaz.com
http://beta.theplaz.com/index.php?title=MediaWiki:Sitenotice
http://beta.theplaz.com/index.php?title=Template:This_Template
http://beta.theplaz.com/index.php?title=Template:Middleman

omniplex wrote:

Out of curiosity I tested it with the "preload" feature
explained on [[Help:Inputbox]], and there the behaviour
is different:

http://meta.wikimedia.org/wiki/abc?action=edit&preload=Template:Preload_demo/1
This gets Preload_demo/1 as is with the <noiclude> part.
http://meta.wikimedia.org/wiki/abc?action=edit&preload=Template:Preload_demo/2
This gets Preload_demo/2 as is, no "middleman" workaround
for "preload". The <includeonly> workaround combined with
parser functions can emulate <noinclude> for "preload".

This seems to have been fixed some time ago by the new parser:

Reading tests from "maintenance/parserTests.txt"...
Running test pre-save transform: <noinclude> in subst (bug 3298)... PASSED
Running test pre-save transform: <onlyinclude> in subst (bug 3298)... PASSED
Running test message transform: <noinclude> in transcluded template (bug 4926)... PASSED
Running test message transform: <onlyinclude> in transcluded template (bug 4926)... PASSED

Resolving FIXED.