Extension talk:PageInCat
Contents
| Thread title | Replies | Last modified |
|---|---|---|
| Good idea | 1 | 20:08, 4 February 2012 |
| Fatal error | 3 | 01:12, 24 January 2012 |
Well in order to make this extension work during preview it had to do some hacky things (Since pages aren't really in a category until its saved, during a preview its not in the newly added category, etc). The way it works around this is the best way i could think of, but its still a little icky, and would be frowned upon if this extension was being reviewed for wikimedia deployment, which is one reason this probably won't appear in parserFunctions extension anytime soon.
Using MediaWiki 1.17.0 I get a "Fatal error: Class 'RequestContext' not found in /var/www/wiki/extensions/PageInCat/PageInCat_body.php on line 231" with the extension installed whenever I try to preview any edit on any page (doesn't matter if it uses {{#incat: or not). I can still save page edits. Other than that the extension works great.
Never mind, I missed the part where it requires 1.19.
Honestly none of this really depends on stuff in 1.19. Replacing the line:
$curUser = RequestContext::getMain()->getUser()
with
$curUser = $GLOBALS['wgUser'];
would in all probability make it work (of course I haven't tested that).