Topic on Extension talk:NamespaceRelations

Mshastchi (talkcontribs)

I get the following error:

Notice: Undefined variable: namespaceInfo in public_html/extensions/NamespaceRelations/src/NamespaceRelations.php on line 189

Notice: Undefined variable: namespaceInfo in public_html/extensions/NamespaceRelations/src/NamespaceRelations.php on line 189
MediaWiki internal error.

Original exception: [25ba14d4dd4845ccb325183c] /index.php?title=whatever)&action=edit&redlink=1 Error: Call to a member function getTalk() on null

I have defined the required namespace and its talk namespace as follows:

// Define additional namespaces.
define("NS_ID", 20002); 
define("NS_ID_TALK", 20003); 

$wgExtraNamespaces[NS_ID] = "id";
$wgExtraNamespaces[NS_ID_TALK] = "id_talk"; 
Phil.o (talkcontribs)

There is a solution for that. The $namespaceInfo variable is initialized in the first if block, but not in the second.

In NamespaceRelations.php file, move the line 118 ($namespaceInfo = MediaWikiServices::getInstance()->getNamespaceInfo();) to line 103, just above the if..else block.

Alternatively, you can copy line 118 in the second block.

Tznkai (talkcontribs)

I can confirm this works.

Reply to "Error"