Page MenuHomePhabricator

Unknown issue with category determination with conditional templates
Closed, InvalidPublic

Description

Author: MediaWiki

Description:
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.

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.


Version: 1.11.x
Severity: major

Attached:

Details

Reference
bz12420

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:55 PM
bzimport set Reference to bz12420.
bzimport added a subscriber: Unknown Object (MLST).

MediaWiki wrote:

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().

MediaWiki wrote:

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

MediaWiki wrote:

Bug was caused by incorrect title-grabbing in an extension.