Extension talk:PageInCat

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Contents

Thread titleRepliesLast modified
Good idea120:08, 4 February 2012
Fatal error301:12, 24 January 2012

I'm really not sure why this function wasn't made a part of Parser Functions from the beginning. It seems so basic. But thanks as always Bawolff, for giving the functionality in an extension.    Thorncrag   19:31, 3 February 2012 (UTC)

   Thorncrag  19:31, 3 February 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.

Bawolff20:08, 4 February 2012
 

Fatal error

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.

-- Ned Scott 03:36, 8 January 2012 (UTC)07:52, 8 January 2012

Never mind, I missed the part where it requires 1.19.

-- Ned Scott 04:59, 8 January 2012 (UTC)07:52, 8 January 2012

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

Bawolff19:01, 8 January 2012

Or apparently not as its also dependant on wfMsg stuff.

Anyhow, I did some checking. This extension should work with any version of MediaWiki greater than or equal to 1.18. I've updated the doc page accordingly

Bawolff01:12, 24 January 2012
 
 
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox