MediaWiki Wikibase Installation Trouble

734 Views Asked by At

I am currently attempting to install the Wikibase extension to my new Mediawiki installation. Here is the php stack trace:

running media wiki  
Notice: Undefined index: entityNamespaces in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Warning: array_merge(): Expected parameter 2 to be an array, null given in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Notice: Undefined index: entityNamespaces in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Warning: array_merge(): Expected parameter 2 to be an array, null given in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Notice: Undefined index: entityNamespaces in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Warning: array_merge(): Expected parameter 2 to be an array, null given in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 212    
Fatal error: Uncaught TypeError: Argument 2 passed to Wikibase\Lib\WikibaseSettings::applyEntityNamespacesToSettings() must be of the type array, null given, called in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 103 and defined in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php:218 Stack trace: #0 /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php(103): Wikibase\Lib\WikibaseSettings::applyEntityNamespacesToSettings(Object(Wikibase\Lib\SettingsArray), NULL) #1 /var/www/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(689): Wikibase\Lib\WikibaseSettings::getClientSettings() #2 /var/www/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(737): Wikibase\Client\WikibaseClient::newInstance() #3 /var/www/mediawiki/extensions/Wikibase/client/includes/Hooks/MagicWordHookHandler.php(39): Wikibase\Client\WikibaseClient::getDefaultInstance() #4 /var/www/mediawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php(172): in /var/www/mediawiki/extensions/Wikibase/lib/includes/WikibaseSettings.php on line 218

I tried to follow the Wikibase Installation guide to the letter to only install Wikibase Client, but I don't think I did. Sepcificially I think my LocalSettings.php is the issue. I installed the extension as instructed by the guide, so I'm confident that I'm using whatever the most recent version of Wikibase is (though I can't seem to find a version number anywere) and I am using MediaWiki 1.35 with PHP 7.3.23-4 on Ubuntu 18.04 hosted with nginx.

This is the bit I added to the end of my LocalSettings.php that breaks my installation, but without I can't use infoboxes, which is my real goal here.

# Wikibase
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";    
$wgWBClientSettings['repoUrl'] = 'https://pool.my.wiki';
$wgWBClientSettings['repoScriptPath'] = '';
$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';
$wgWBClientSettings['repositories']['']['repoDatabase'] = 'poolwiki';
$wgWBClientSettings['repositories']['']['changesDatabase'] = 'poolwiki';
$wgWBClientSettings['siteLinkGroups'] = [ 'mywikigroup' ];
wgWBClientSettings['siteGlobalID'] = 'en';

I'm sure I just bungled an obvious step somewhere, but I've been over it so many times and I have no idea where.

I try to document all new installations very thoroughly for situations just like this, you can find my current setup along with the steps I took during installation on my github repository: https://github.com/PickleProgramming/AlQinaWiki

You can find my full LocalSettings.php there, along with any other files I might have bungled.

1

There are 1 best solutions below

4
On BEST ANSWER

First of all, you need to switch your WikiBase to the version 1.35. Currently, you have 1.36 (master):

cd .../extensions/WikiBase
git checkout REL1_35
git pull
git submodule update --init --recursive

You also may need to install dependencies with Composer as described here.

Secondly, make sure that your wiki doesn't think that it is also a WikiBase repository. Insert $wgEnableWikibaseRepo = false before wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );

Thirdly, which wiki is going to serve as a WikiBase repository for you?