Extension talk:PageInCat

Jump to navigation Jump to search

About this board

Compatible with MW 1.34.x?

Summary by Bawolff


Kghbln (talkcontribs)

I am getting an "Call to undefined method ParserOptions::setEditSection()" error when trying to create a category. Reported with task T235602. (talkcontribs)

I installed according to the directions and now get:

Warning: require_once(/home/herbal7/public_html/mwiki/extensions/PageInCat/PageInCat.php): failed to open stream: No such file or directory in/home/herbal7/public_html/mwiki/LocalSettings.php on line 217

Fatal error: require_once(): Failed opening required '/home/herbal7/public_html/mwiki/extensions/PageInCat/PageInCat.php' (include_path='/home/herbal7/public_html/mwiki/vendor/pear/pear_exception:/home/herbal7/public_html/mwiki/vendor/pear/console_getopt:/home/herbal7/public_html/mwiki/vendor/pear/pear-core-minimal/src:/home/herbal7/public_html/mwiki/vendor/pear/mail_mime:/home/herbal7/public_html/mwiki/vendor/pear/mail_mime-decode:/home/herbal7/public_html/mwiki/vendor/pear/net_socket:/home/herbal7/public_html/mwiki/vendor/pear/net_smtp:/home/herbal7/public_html/mwiki/vendor/pear/mail:.:/usr/local/lib/php') in /home/herbal7/public_html/mwiki/LocalSettings.php on line 217


I notice that there's no PageInCat.php in the extensions/PageInCat directory, so obviously this is the problem. I downloaded from three places, and it's not there in any of them. If I changed the name to PageInCat_body.php in LocalSettings.php, the above error goes away, but the #incat code doesn't work (I see the curly braces and everything.)

Bawolff (talkcontribs)

Sorry, some instructions were outdated. You should now install this extension by doing wfLoadExtension( 'PageInCat' );

Reply to "Doesn't Work"
Peachey88 (Flood) (talkcontribs)

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.

This post was posted by Peachey88 (Flood), but signed as Ned Scott.

Peachey88 (Flood) (talkcontribs)
Bawolff (talkcontribs)

Honestly none of this really depends on stuff in 1.19. Replacing the line:

$curUser = RequestContext::getMain()->getUser()


$curUser = $GLOBALS['wgUser'];

would in all probability make it work (of course I haven't tested that).

Bawolff (talkcontribs)

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

Reply to "Fatal error"
Thorncrag (talkcontribs)

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)

Bawolff (talkcontribs)

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.

Reply to "Good idea"
There are no older topics