Extension talk:MsCatSelect

Jump to navigation Jump to search

About this board

Namespace constants not working with MW 1.34.2

1 (talkcontribs)

The NS_FILE, etc. constants are not working when used with $wgMSCS_WarnNoCategoriesException[]

I was able to use the canonical namespace names by extending the function mscsCheckCategories() in file MsCatSelect.js as shown below:

function mscsCheckCategories() {

   if ( mscsVars.WarnNoCategories === true &&

        jQuery( '#mscs-added input[type="checkbox"]:checked' ).length === 0 &&

        jQuery.inArray( mw.config.get( 'wgNamespaceNumber' ), mscsVars.WarnNoCategoriesException ) === -1 &&

        jQuery.inArray( mw.config.get( 'wgCanonicalNamespace' ), mscsVars.WarnNoCategoriesException ) === -1 &&

        jQuery.inArray( mw.config.get( 'wgRelevantPageName' ), mscsVars.WarnNoCategoriesException ) === -1

   ) {

       return confirm( mediaWiki.msg( 'mscs-warnnocat' ) );


   return true;


This allows using:

$wgMSCS_WarnNoCategoriesException[] = 'Talk';

$wgMSCS_WarnNoCategoriesException[] = 'User';

$wgMSCS_WarnNoCategoriesException[] = 'User_talk';

$wgMSCS_WarnNoCategoriesException[] = 'Project';

$wgMSCS_WarnNoCategoriesException[] = 'Project_talk';

$wgMSCS_WarnNoCategoriesException[] = 'File';

$wgMSCS_WarnNoCategoriesException[] = 'File_talk';

$wgMSCS_WarnNoCategoriesException[] = 'MediaWiki';

$wgMSCS_WarnNoCategoriesException[] = 'MediaWiki_talk';

$wgMSCS_WarnNoCategoriesException[] = 'Template';

$wgMSCS_WarnNoCategoriesException[] = 'Template_talk';

$wgMSCS_WarnNoCategoriesException[] = 'Help';

$wgMSCS_WarnNoCategoriesException[] = 'Help_talk';

$wgMSCS_WarnNoCategoriesException[] = 'Category_talk';

instead of namespace constants.

May be one could use the work-around too.

Reply to "Namespace constants not working with MW 1.34.2" (talkcontribs)

When previewing selected categories are gone.

In addition for previewing a newly created page with categories applied the no category message is displayed too, would be nice to disable this.

Thanks for considering this.

Reply to "Category check on preview"

Does not grab main categories automatically

Heinebold (talkcontribs)

I need to explicitly fill in the $wgMSCS_MainCategories, otherwise I will get an empty dropdown (only containing a --- line).

I also tried explicitly setting it empty, but that didn't help. Edit: I also tried to unset() it, also without success.

What could be my problem?

I am on MediaWiki 1.34.0, MsCatSelect 6.3 (695a361)

Thanhpg (talkcontribs)

Seems it is due to output of Uncategorizedcategories api change in 1.34.x

Quick fix is to MsCatSelect.js's function mscsGetUncategorizedCats as followed:

function mscsGetUncategorizedCats( dd ) {
		'format': 'json',
		'action': 'query',
		'list': 'querypage',
		'qppage': 'Uncategorizedcategories',
		'qplimit': 500
    }).done( function( data ) {
		mediaWiki.log( data );
		if ( data && data.query && data.query.querypage ) {
			// Success!
			jQuery.each( data.query.querypage.results, function( index, val ) {
				jQuery( '<option>', { value: index + 1, text: val.title.replace( /Category:/g, '' ) } ).appendTo( dd );
			if ( chosenDropDown ) {
				dd.chosen( { disableSearchThreshold: 6 } );
				jQuery( '#mscs_dd_0_chzn' ).width( dd.width() + 30 );
		} else if ( data && data.error ) {
			mediaWiki.log( 'Error: API returned error code "' + data.error.code + '": ' + data.error.info );
		} else {
			mediaWiki.log( 'Error: Unknown result from API.' );
Reply to "Does not grab main categories automatically"

Limit of 10 categories per page???

S pokras (talkcontribs)

It appears that MsCatSelect does a good job up to 10 categories on a page. When I edit pages that have more than 10 categories, all except 10 are eliminated. I have pages with up to 60 categories. Yes, I know that may seem silly, but there is a reason for it.

So, it's not tolerable to have an extension that deletes existing categories.

Is this a feature? Or a Bug? Is there a fix? I need to allow pages to have up to 100 categories for my system to be useful. See http://wikidelphia.org/Wikidelphia:About to see what we're doing.

Reply to "Limit of 10 categories per page???"

More elements in a MainCategories array

S pokras (talkcontribs)

We have Wikidelphia in Philadelphia, PA

$wgMSCS_MainCategories = array( 'Category1', 'Category2' );

When I put more than 9 elements in the array, I get an error message when starting my Wiki.

*Is there some way to be able to add more?

*In my case I'd like about 12 "Top Level Tags" (perhaps a few more in the future)

If someone has a fix for this, please write me: stan(at)communitymagic(dot)org

Thank you!

S pokras (talkcontribs)

I believe that my problem was caused by incorrect coding of the apostrophe. I have added additional items to the array by copying the items that are working, pasting that and editing it to contain the appropriate category name. My setup tries to edit both copies of a pasted item, so I have had to start editing the copied category by just adding to it and then deleting the unnecessary text.

I have a much more important issue with McCatSelect deleting any more than ten categories if they exist. I'll post that in a new topic.

Reply to "More elements in a MainCategories array"

SMW semantic search #ask conflict

Michele.Fella (talkcontribs)

NOTE: This extension at the time of writing will cause used within SMW semantic search to be removed from your query as it will be considered a declaration of the page category rather than a condition. I am sure this will be fixed.

Reply to "SMW semantic search #ask conflict"

make MsCatSelect compatible with Visual editor

Lucs7 (talkcontribs)

Also the VisualEditor extension provides a too to add categories, it fails in the simplicity to select categories from a dropdown menu. Thus, MsCatSelect does a much better job, unfortunately the category select dialogue is not shown under the Edit page, if VisualEditor is enabled. is there any solution yet?

SmartK (talkcontribs)

This would be soooo good. I hope MsCatSelect gets picked up by the mediawiki developers soon ;-) (talkcontribs)


I wanted to as whether there is some progress on this. I tried adding MsCatSelect to visual editor myself but I was only partly successful - could view categories but couldn't manage.

Anybody knows how to hook it up properly with VisualEditor?

Thanks and have a nice day!

Reply to "make MsCatSelect compatible with Visual editor"

Where are the categories assigned ?

Kikibl0p (talkcontribs)

Hey guys,

I'm quite new to MediaWiki, and I have a simple question : where does the category go when you assign it with MsCatSelect ?

When you don't use the plugin, to assign a category, you use this : [[Category:xxx]]

Using this means you keep it inside the page, import / export are covered.

How does MsCatSelect store this information ?

FreedomFighterSparrow (talkcontribs)

Hi, it still goes in the wikitext in the regular way - the extension simply removes it from the wikitext before you start editing, and inserts it back on save.

Kikibl0p (talkcontribs)

Thank you, I found it in the XML export version :)

Reply to "Where are the categories assigned ?"

Now finally works with 1.31.1!!!

SmartK (talkcontribs)

Please user "master" version

Reply to "Now finally works with 1.31.1!!!"

NS_MEDIAWIKI not working with $wgMSCS_WarnNoCategoriesException

CptTwinkie (talkcontribs)

I get the warning every time. The exact setting in my LocalSettings.php is

$wgMSCS_WarnNoCategoriesException = array( NS_TALK, NS_FILE_TALK, NS_MEDIAWIKI, 'Main Page' );

Is this correct behavior?

Reply to "NS_MEDIAWIKI not working with $wgMSCS_WarnNoCategoriesException"