Hello, I recently upgraded to MediaWiki 1.37.0 and used the settings mentioned here. I'd like to continue using the main namespace for items, so my Wikibase.example.php
looks like this:
// Alternative settings, using the main namespace for items. // Note: if you do that, several core tests may fail. Parser tests for instance // assume that the main namespace contains wikitext. $baseNs = 120; // NOTE: do *not* define WB_NS_ITEM and WB_NS_ITEM_TALK when using a core namespace for items! define( 'WB_NS_PROPERTY', $baseNs +2 ); define( 'WB_NS_PROPERTY_TALK', $baseNs +3 ); define( 'WB_NS_QUERY', $baseNs +4 ); define( 'WB_NS_QUERY_TALK', $baseNs +5 ); // You can set up an alias for the main namespace, if you like. //$wgNamespaceAliases['Item'] = NS_MAIN; //$wgNamespaceAliases['Item_talk'] = NS_TALK; // No extra namespace for items, using a core namespace for that. $wgExtraNamespaces[WB_NS_PROPERTY] = 'Property'; $wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk'; $wgExtraNamespaces[WB_NS_QUERY] = 'Query'; $wgExtraNamespaces[WB_NS_QUERY_TALK] = 'Query_talk'; // Tell Wikibase which namespace to use for which kind of entity $wgWBRepoSettings['entitySources'] = [ 'local' => [ 'entityNamespaces' => [ 'item' => NS_MAIN, // <=== Use main namespace for items!!! 'property' => WB_NS_PROPERTY, // use custom namespace 'query' => WB_NS_QUERY, // use custom namespace ], 'repoDatabase' => $wgDBname, 'baseUri' => $wgServer . '/wiki/', 'rdfNodeNamespacePrefix' => 'wd', 'rdfPredicateNamespacePrefix' => '', 'interwikiPrefix' => '', ], ];
I am able to create new items via Special:NewItem and I can edit them properly. However, all old items aren't editable and look like this:
{"type":"item","id":"Q1","labels":{"en":{ [...]
When I use Special:Export to export the new items, the XML file contains the following lines:
<model>wikibase-item</model> <format>application/json</format>
The old items contain lines like these:
<model>wikitext</model> <format>text/x-wiki</format>
The Page information of the old and new items show: Page content model: Wikibase Item. When I try to edit an old item via https://data.domain.com/wiki/Special:SetLabelDescriptionAliases/Q1/en, the following error shows up:
Internal error [123456789] /wiki/Special:SetLabelDescriptionAliases/Q1/en TypeError: Argument 2 passed to Wikibase\Repo\Notifications\WikiPageActionEntityChangeFactory::newForPageModified() must be an instance of Wikibase\Repo\Content\EntityContent, instance of WikitextContent given, called in /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/ChangeNotifier.php on line 149 Backtrace: from /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/WikiPageActionEntityChangeFactory.php(82) #0 /path/to/data/w/extensions/Wikibase/repo/includes/Notifications/ChangeNotifier.php(149): Wikibase\Repo\Notifications\WikiPageActionEntityChangeFactory->newForPageModified() #1 /path/to/data/w/extensions/Wikibase/repo/includes/RepoHooks.php(254): Wikibase\Repo\Notifications\ChangeNotifier->notifyOnPageModified() #2 /path/to/data/w/includes/HookContainer/HookContainer.php(338): Wikibase\Repo\RepoHooks::onRevisionFromEditComplete() #3 /path/to/data/w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook() #4 /path/to/data/w/includes/HookContainer/HookRunner.php(3191): MediaWiki\HookContainer\HookContainer->run() #5 /path/to/data/w/includes/Storage/PageUpdater.php(1255): MediaWiki\HookContainer\HookRunner->onRevisionFromEditComplete() #6 /path/to/data/w/includes/Storage/PageUpdater.php(833): MediaWiki\Storage\PageUpdater->doModify() #7 /path/to/data/w/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(403): MediaWiki\Storage\PageUpdater->saveRevision() #8 /path/to/data/w/extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityStore.php(262): Wikibase\Repo\Store\Sql\WikiPageEntityStore->saveEntityContent() #9 /path/to/data/w/extensions/Wikibase/lib/includes/Store/TypeDispatchingEntityStore.php(85): Wikibase\Repo\Store\Sql\WikiPageEntityStore->saveEntity() #10 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEntityStore.php(53): Wikibase\Lib\Store\TypeDispatchingEntityStore->saveEntity() #11 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/MediawikiEditEntity.php(735): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEntityStore->saveEntity() #12 /path/to/data/w/extensions/Wikibase/repo/includes/EditEntity/StatsdSaveTimeRecordingEditEntity.php(77): Wikibase\Repo\EditEntity\MediawikiEditEntity->attemptSave() #13 /path/to/data/w/extensions/Wikibase/repo/includes/Specials/SpecialWikibaseRepoPage.php(194): Wikibase\Repo\EditEntity\StatsdSaveTimeRecordingEditEntity->attemptSave() #14 /path/to/data/w/extensions/Wikibase/repo/includes/Specials/SpecialModifyEntity.php(219): Wikibase\Repo\Specials\SpecialWikibaseRepoPage->saveEntity() #15 /path/to/data/w/includes/specialpage/SpecialPage.php(647): Wikibase\Repo\Specials\SpecialModifyEntity->execute() #16 /path/to/data/w/includes/specialpage/SpecialPageFactory.php(1366): SpecialPage->run() #17 /path/to/data/w/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath() #18 /path/to/data/w/includes/MediaWiki.php(925): MediaWiki->performRequest() #19 /path/to/data/w/includes/MediaWiki.php(559): MediaWiki->main() #20 /path/to/data/w/index.php(53): MediaWiki->run() #21 /path/to/data/w/index.php(46): wfIndexMain() #22 {main}
Any help is more than appreciated!
Thanks and cheers,
Till