Last modified: 2010-05-15 15:59:41 UTC
Created attachment 4471 [details] Wikitext source of the template I'm having issues with I have a reasonably complex conditional template that I'm trying to use for both visible tagging and auto-categorization of protected pages. So far, it works OK, but the categories are behaving strangely. I've included the template source as an attachment. I have enabled $wgUseCategoryBrowser, and also installed [[mw:Extension:RightFunctions]] for the very purpose of creating templates like this. The issue is, the pages with the template on them, if they are protected (have a non-empty {{#getrestrictions:edit}}), sometimes display the protection category in the normal list, but the template removal queue cat in the browser list. They show up in the latter category, but not in the protection category, which goes beyond a display bug. I'm not sure how to fix this, and have tried about 50 revisions of the template, tweaking things here and there to try and make it work, but I just can't. That's why I'm reporting this as a bug; I don't think it's anything I'm doing, given the dual display and wrong-category issues. Unless I'm being affected by a weird ParserFunctions problem... So, a little background: The template {{!}} is the same as it is on en.Wikipedia; just a pipe ('|') character. If this isn't a MediaWiki bug, I certainly hope I can at least get some help with the template; it's been driving me batty all day.
Dang it! I forgot to mention, the category links are all fine after I run maintenance/refreshLinks.php, but they break again the next time the problem template is edited. Perhaps this is an issue with the job-running code or something - I haven't studied enough about MediaWiki internals to be sure.
Looks like your extension is using $wgTitle... that's bad mojo, as I believe $wgTitle may belong to someone else during background updates. You should instead pull the current title from the parser, eg $parser->getTitle().
I've mentioned this bug to the extension's (RightFunctions') developer (Skizzerz), so we'll see what he does with it. I'll keep track of this bug, and if I can fix it by tweaking an extension, I'll self-INVALID it. I still haven't managed to get it to work right... :P
Bug was caused by incorrect title-grabbing in an extension.