Wikimedia Developer Support

Something wrong with extra namespace

I have an extra namespace that’s broken and I’m not sure how to fix it. When searching for content, you can find results that reference pages that used to exist. Now navigating to those pages results in “There is currently no text in this page.

The namespace was previously configured as the ‘project’ namespace (100 and 101) but even if I change the definition like

define("NS_NAMIC", 3000);
define("NS_NAMIC_TALK", 3001);
$wgExtraNamespaces[NS_NAMIC] = "NAMIC_Wiki";
$wgExtraNamespaces[NS_NAMIC_TALK] = "NAMIC_Wiki_Talk";

I’m not able to get MediaWiki to find the content that belongs with each title.

The PrefixIndex Special Page shows that I have a namespace ‘4’ with the articles in question. But most of those titles exhibit the ‘no text’ problem. For example

I did try to fix the broken namespace using
php w/maintenance/namespaceDupes.php --wiki=namic --fix
and got results like

id=3594 ns=0 dbk=NAMIC_Wiki:About *** dest title exists and --add-prefix not specified
id=3188 ns=0 dbk=NAMIC_Wiki:Community_Coordinate_Systems -> NAMIC_Wiki:Community_Coordinate_Systems (no conflict)
id=3443 ns=0 dbk=NAMIC_Wiki:Community_DTI -> NAMIC_Wiki:Community_DTI (no conflict)
id=4197 ns=0 dbk=NAMIC_Wiki:Community_IGT -> NAMIC_Wiki:Community_IGT (no conflict)
id=3295 ns=0 dbk=NAMIC_Wiki:Community_Licensing -> NAMIC_Wiki:Community_Licensing (no conflict)
id=3326 ns=0 dbk=NAMIC_Wiki:Community_Licensing_Institutional_Experiences -> NAMIC_Wiki:Community_Licensing_Institutional_Experiences (no conflict)

Although that definitely was aware of the problem titles, there still isn’t any content associate with those titles that were fixed.

I changed the configuration back to

$wgExtraNamespaces[NS_PROJECT] = "NAMIC_Wiki";
$wgExtraNamespaces[NS_PROJECT_TALK] = "NAMIC_Wiki_Talk";

and everything is working correctly. So, it appears that a combination of running namespaceDupes and having a correct configuration made it work.

So if you want the project namespace to be NAMIC_Wiki, you should probably set $wgMetaNamespace instead of $wgExtraNamespaces. $wgExtraNamespaces probably works too, but I think its better to use $wgMetaNamespace / $wgMetaNamespaceTalk instead to customize the name of the project namespace.

If you actually want it to use the new wiki name but still work with old pages for backwards compatibility reasons, use $wgNamespaceAliases.



Confirming that this is the proper configuration and works for me:

$wgMetaNamespace = "NAMIC_Wiki"; 
$wgMetaNamespaceTalk = "NAMIC_Wiki_Talk";