Jump to content

Extension talk:PageInCat

About this board

Acnh Player (talkcontribs)

This message always appears to a page containing a category, even if the #incat parser function is not used.

Warning: The category Pages with broken file links was detected incorrectly by {{#incat:...}}, and as a result this preview may be incorrect. This can be caused by including categories inside of {{#incat:...}} statements, and may result in inconsistent display.

Content of the page:

{{Policy}} This page is a general overview of all the policies. There are multiple policies practiced on Blookipedia, and are listed below. == General article rules and adequate == # Articles should show a neutral point of view, it should not contain personal opinions. # Articles should be written in a formal tone, not in a funny or comic tone. Users should avoid using textspeak words. # Articles must only contain content that is appropriate for all ages. # Articles should not be written in second person. Example: ''You need the have 20 tokens the open a pack'' should be ''The player must have 20 tokens to open a pack''. [[Category:Policies]]

Want (talkcontribs)

Use precopy text please – line in wikicode start with a space.

here is example

In code template 'Policy' is probably your problematic code.

Acnh Player (talkcontribs)

My point is, there is no #incat parser function on the page

Want (talkcontribs)

Function is transcluded from template probably. Warning is symptom, that automatic generated category "Pages with broken file links" inexists. I don't use this extension because Extension:CategoryTests do same effect, but I tested it.

Reply to "Help"

Compatible with MW 1.34.x?

1
Summary by Bawolff

Fixed

Kghbln (talkcontribs)

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

76.9.87.51 (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

<hr>

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

with

$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