1

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.

Tgr
  • 27,442
  • 12
  • 81
  • 118
KingOfEphrya
  • 129
  • 1
  • 2
  • 11

1 Answers1

3

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?

Alexander Mashin
  • 3,892
  • 1
  • 9
  • 15
  • Thank you very much, I had a hunch that Wikibase was wrong, but I couldn't find a definitive version number anywhere. I saw the 1.36 mentioned in the guide, but I wasn't sure if that was a fork or the master. Where would I see the version of master? I checked their github, the site it was hosted on, several files in the package, couldn't find it anywhere. And I was thinking the main wiki? I'm a little fuzzy on this. My end goal is just being able to have all the stable features of regualr Wikipedia like Infoboxes, Birth/Death days, etc. Is that possible? – KingOfEphrya Oct 21 '20 at 08:34
  • It is not explicitly stated anywhere, as far as I know, but do `git diff REL1_35 master` and you will see the difference; and you versions of `MediaWiki` and *WikiBase* neen to be the same. The errors you have is only possible in those places in `master`. – Alexander Mashin Oct 21 '20 at 09:16
  • When I last checked, *WikiData* served as a *WikiBase* repository only to wikis run by *WikiMedia Foundation*. – Alexander Mashin Oct 21 '20 at 09:17
  • Alright thanks. What you gave in your answer got rid of the error, and now I'm looking at a (Cannot Access Database) page, then I configured in a WikiBase repo and its working now! I knew that WikiBase and MediaWiki needed to be the same version, but I just kinda assumed that if the tutorial told me to do it this way, then surely the master branch was the proper WikiBase version for the current release. Shoulda thought to use diff, thanks again! – KingOfEphrya Oct 21 '20 at 09:42