Last modified: 2009-06-24 00:35:45 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 T10675, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8675 - Unexpect behaviour when substing templates with substed parser functions.
Unexpect behaviour when substing templates with substed parser functions.
Status: RESOLVED DUPLICATE of bug 5453
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://test.wikipedia.org/wiki/Templa...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-17 15:02 UTC by Nux
Modified: 2009-06-24 00:35 UTC (History)
2 users (show)

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


Attachments

Description Nux 2007-01-17 15:02:03 UTC
I'll explain on a simple example...

Let's say I have a template called Substing, it's source is:
{{#if:{{{1|}}}|{{{1}}}|7}}

Now let us have 3 situations:
1. {{subst:Substing}}
2. {{subst:Substing|}}
3. {{subst:Substing|3}}

This should give me:
1. 7
2. 7
3. 3

So far it all works, but now let's say I want the template to be permanent (so
there will only be numbers in the source). Should be easy - changing the source to:
{{<includeonly>subst:</includeonly>#if:{{{1|}}}|{{{1}}}|7}}

And now let us have those 3 situations:
1. {{subst:Substing}}
2. {{subst:Substing|}}
3. {{subst:Substing|3}}

This should give me:
1. 7
2. 7
3. 3

But it gives me:
1. {{{1}}}
2. 7
3. 3

So the first one is wrong.

More tests (both for #if and #ifeq):
http://test.wikipedia.org/wiki/Template_talk:Substing#subst_table
Comment 1 TMg 2007-09-04 19:27:29 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 2 Jelte (WebBoy) 2008-08-11 19:43:23 UTC
This bug is fixed with the new preprocessor.

(In reply to comment #1)
> 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}}.
> 

This is bug 5453.
Comment 3 Splarka 2009-06-24 00:35:45 UTC

*** This bug has been marked as a duplicate of bug 5453 ***

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


Navigation
Links