Last modified: 2011-04-14 15:12:06 UTC
If you have a specialpage which uses $wgOut->addWikiText(), as recommended on http://meta.wikimedia.org/w/index.php/Writing_a_new_special_page#OutputPage- .3EaddWikiText.28.29 , and that page is transcluded into a page more than once (or two such pages are transcluded, etc), then all but the last transclusion are displayed as the "\07UNIQ-" replacement token rather than the page output. This appears to be caused by OutputPage::addWikiText requesting the parser state be cleared after execution, removing the earlier transcluded HTML from the replacement table before it's actually substituted in the document. As a workaround for my own use, I've written my own MySpecialPage->addWikiText () which doesn't clear the state (but may well break other things) - but if this is the preferred(/documented) way of writing special pages, then it may need fixing for other people too. I first saw this when trying to transclude multiple different subpages of my IncludableSpecialPage, but have since confirmed it happens in the more general case. Predictably $wgOut->addHTML() does not cause this problem as the parser is not invoked.
Probably the cleanest way for getting around this bug without losing the ability to use wiki syntax is writing your own small function that looks something like this: function addText( $text ) { global $wgTitle, $wgOut, $wgParser; $po = $wgParser->parse( $text, $wgTitle, $wgParser->mOptions, false, false ); $wgOut->addHTML( $po->getText() ); } Then simply use this function instead of addWikiText.
Just use wfMsgExt with the parse option.