Last modified: 2007-08-02 21:17:23 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 10757 - Problem with wikilinks in template Parameter
Problem with wikilinks in template Parameter
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-07-30 22:33 UTC by blauerflummi
Modified: 2007-08-02 21:17 UTC (History)
3 users (show)

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


Description blauerflummi 2007-07-30 22:33:52 UTC
There is a Problem with wikilinks in template parameters. I wanted to use the template

Some of the parameters add  [[ and ]] to the parameter text in order to automatically generate wikilinks. I want to use the parameter Art, to display two links. Therefore I tried the parameter text" Link1]] , [[Link2". the brakets in the beginning and the end should be inserted automatically, as you can see in the source  code:

{{#if: {{{Art|}}} |
! [[Bahnhof#Bahnhofsarten|Art]]

However, the result is not as supposed. Instead, the layout gets totally messed up, as you can see here: (Use the version history, to see, what it should look like.

What is the reason for this problem, and how can It be solved?
Comment 1 Thomas "Tango" Dalton 2007-07-30 23:18:15 UTC
I think the parser is getting confused when it sees the end of a wikilink without being able to find the start of it, and it never realises that it is in a template parameter, so ends up not parsing anything at all and just outputs the wikitext. It's possible the parser could be altered to work better in this situation, but I doubt it would be easy. I think your best bet is to alter the template (perhaps add an alternative parameter which doesn't have [[ and ]] added to it).
Comment 2 Steve Sanbeg 2007-07-31 22:54:55 UTC
The problem is that once the parser starts parsing the [[, then the | is used for that.  The solution is to delay parsing the link until after the template is parsed.  I've already fixed the example page listed; this behavior is inherent in the syntax, so changing the parser wouldn't help.

Comment 3 TMg 2007-08-02 18:34:54 UTC
This is not a parser bug. Simple change the template:

{{#ifexist: {{{Art}}} | [[{{{Art}}}]] | {{{Art}}} }}

Then almost all kinds of parameter text can be used:

Art = Link1
Art = [[Link1]]
Art = [[Link1]], [[Link2]]
Comment 4 Thomas "Tango" Dalton 2007-08-02 21:17:23 UTC
That's not perfect - really you want an #isAValidPageName rather than #ifexist, otherwise you won't get redlinks for pages that could exist but don't.

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