Author: wikipedista
Description:
Using {{{vars}}} in the else text of a ParserFunctions #if causes a bug, in which both the "then" and the else text are showed.
#if syntax and example:
{{ #if: <condition> | <then text> | <else text> }}
{{ #if: {{{parameter|}}} | Parameter is defined. | Parameter is undefined, or empty }}
For example, lets say that I want to change the text of a template depending on the number of variables set. In this case, if {{{2}}} is defined the text will be in the plural and both variables {{{1}}} and {{{2}}} will be showed.
* {{ #if: {{{2|}}} | The articles {{{1}}} and {{{2}}} are nice. | The article {{{1}}} is nice. }}
The problem is that, because of the use of variables in the else text the #if will output the following:
- The article The articles {{{1}}} and {{{2}}} are nice. is nice.
A duplication of the bug may be seen on the sandbox at Wikipedia (EN): http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&oldid=49532948
Best regards,
Version: unspecified
Severity: major
URL: http://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&oldid=49532948