Topic on Extension talk:Wikibase Client

Till Kraemer (talkcontribs)

Hi, after upgrading to MediaWiki 1.28.0, I'm getting the following error when I use {{#property:P1|from=Q3}} in an article:

Failed to render property P1: Property not found for label 'P1' and language 'en'

Property P1 used to show an URL (official website) and is still available in the data repository.

Client's LocalSettings.php:

$wgEnableWikibaseRepo = false;
$wgEnableWikibaseClient = true;
$wmgUseWikibaseRepo = false;
$wmgUseWikibaseClient = true;
require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";

$GLOBALS['wgWBClientSettings']['siteGlobalID'] = "enwiki";

$wgWBClientSettings['repoUrl'] = 'https://data.domain.com';
$wgWBClientSettings['repoScriptPath'] = '/w';
$wgWBClientSettings['repoArticlePath'] = '/wiki/$1';
$wgWBClientSettings['siteGlobalID'] = 'enwiki';
$wgWBClientSettings['repoDatabase'] = 'datawiki';
$wgWBClientSettings['changesDatabase'] = 'datawiki';
$wgWBClientSettings['repoSiteId'] = 'datawiki';
$wgWBClientSettings['repoSiteName'] = 'Myprojectname';
$wgWBClientSettings['siteLinkGroup'] = 'myprojectname';
$wgWBClientSettings['siteGroup'] = 'myprojectname';
$wgWBClientSettings['sort'] = 'code';

Repository's LocalSettings.php:

$wgEnableWikibaseRepo = true;
$wgEnableWikibaseClient = false;
$wmgUseWikibaseRepo = true;
$wmgUseWikibaseClient = false;
require_once __DIR__ . "/extensions/Wikidata/Wikidata.php";
require_once __DIR__ . "/extensions/Wikidata/extensions/Wikibase/repo/ExampleSettings.php";

$baseNs = 100;
define( 'WB_NS_PROPERTY', $baseNs + 2 );
define( 'WB_NS_PROPERTY_TALK', $baseNs + 3 );
$wgExtraNamespaces[WB_NS_PROPERTY] = 'Property';
$wgExtraNamespaces[WB_NS_PROPERTY_TALK] = 'Property_talk';
$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_ITEM] = NS_MAIN; 
$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_PROPERTY] = WB_NS_PROPERTY;
define( 'WB_NS_QUERY', $baseNs + 4 );
define( 'WB_NS_QUERY_TALK', $baseNs + 5 );
$wgExtraNamespaces[WB_NS_QUERY] = 'Query';
$wgExtraNamespaces[WB_NS_QUERY_TALK] = 'Query_talk';
$wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_QUERY] = WB_NS_QUERY;
$wgWBRepoSettings['changesDatabase'] = 'datawiki';
$wgWBRepoSettings['conceptBaseUri'] = 'https://data.domain.com/wiki/';
$wgWBRepoSettings['localClientDatabases'] = array( 'dewiki', 'enwiki' );

I also tried to use wfLoadExtension( 'Wikidata' ); in the LocalSettings.php files, but that didn't work at all.

Logfile:

[...]

[Wikibase\SettingsArray] getSetting: setting thisWikiIsTheRepo was given as a closure, resolve it to false
[Wikibase\SettingsArray] getSetting: setting repoNamespaces was given as a closure, resolve it to array (
'item' => '',
'property' => 'Property',
)
Fully initialised

[...]

[Wikibase\SettingsArray] getSetting: setting entityNamespaces was given as a closure, resolve it to array (
'item' => 0,
'property' => 120,
)
Unstubbing $wgLang on call of $wgLang::getCode from Wikibase\Client\WikibaseClient::getDefaultValueFormatterBuilders

[...]

[Wikibase\SettingsArray] getSetting: setting repoConceptBaseUri was given as a closure, resolve it to 'https://data.domain.com/entity/'
[Wikibase\Lib\Store\WikiPageEntityRevisionLookup] getEntityRevision: Looking up entity Q3 (revision 0).
[DBConnection] LoadBalancer::openForeignConnection: opened new connection for 0/datawiki
[DBConnection] LoadBalancer::reuseConnection: freed connection 0/datawiki
[Wikibase\Lib\Store\WikiPageEntityRevisionLookup] loadEntityBlob: Calling getRevisionText() on revision 16630
[DBConnection] LoadBalancer::openForeignConnection: reusing free connection 0/datawiki
[DBConnection] LoadBalancer::reuseConnection: freed connection 0/datawiki

[...]

I don't really understand the https://data.domain.com/entity/ part, since the URL of an item actually looks like this: https://data.domain.com/wiki/Q3 ...and a property looks like this: https://data.domain.com/wiki/Property:P1.

Any help is more than welcome! Thanks and cheers!

Thiemo Kreuz (WMDE) (talkcontribs)

I'm afraid there is not enough information to fully understand the problem. If it worked before but stopped working after an update it must be something we updated in the code base, but you did not updated in your configuration. Please have a look at the example configuration in Wikibase.example.php. The entityNamespaces setting changed a bit. I also wonder if you checked your Q3 item. Are you sure it contains a statement for the property P1?

Till Kraemer (talkcontribs)

@Thiemo Mättig (WMDE), thanks for your help!

In Wikibase.example.php, I set $wgWBRepoSettings['siteLinkGroups'] = [ 'myprojectname' ]; and $wgWBRepoSettings['specialSiteLinkGroups'] = [ 'pool', 'data' ]; like I used to do.

I now changed $wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_ITEM] = NS_MAIN; to $wgWBRepoSettings['entityNamespaces']['item'] = NS_MAIN; and $wgWBRepoSettings['entityNamespaces'][CONTENT_MODEL_WIKIBASE_PROPERTY] = WB_NS_PROPERTY; to $wgWBRepoSettings['entityNamespaces']['property'] = WB_NS_PROPERTY; in LocalSettings.php, since it looks to me like this is the current way to do this (by the way, should this be updated here or is it still up-to-date?).

I'm still getting the old "Property not found" error though. P1 is actually still in the statements section of Q3. It used to work before, but I checked it anyway like a million times :) Cheers!

Reply to "Property not found"