Topic on Extension talk:MsCatSelect

Namespace constants not working with MW 1.34.2

3
178.115.130.63 (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.

Johnywhy (talkcontribs)

no reply from dev?

Sophivorus (talkcontribs)

Fixed! Please download the latest version.