Page MenuHomePhabricator

entitysources: DatabasePropertyTermStore and DatabaseItemTermStore should not perform any writes operations for items/properties from non-local source
Closed, ResolvedPublic

Description

Currently both DatabaseItemTermStore and DatabasePropertyTermStore check whether they should perform write operation based on the "foreign id prefix" (check via DatabasePropertyTermStore::disallowForeignEntityIds).
In case (e.g. Wikimedia Commons) where items and/or properties are coming from the database of non-local entity sources those classes should not do any INSERTs or DELETEs either, despite the ID having no custom prefix.

For similar checks, WikiPageEntityStore has assertCanStoreEntity:

private function assertCanStoreEntity( EntityId $id ) {
	if ( $this->dataAccessSettings->useEntitySourceBasedFederation() ) {
		$this->assertEntityIdFromKnownSource( $id );
		return;
	}

		$this->assertLocalEntityId( $id );
}

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
ResolvedRamsey-WMF
ResolvedCparle
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
OpenNone
OpenNone
ResolvedWMDE-leszek
ResolvedAddshore

Event Timeline

Change 567489 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] DatabaseProperty/ItemTermStore: take entity source config into account

https://gerrit.wikimedia.org/r/567489

Change 567489 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] wbterms: Take entity source config into account for DatabaseProperty/ItemTermStore

https://gerrit.wikimedia.org/r/567489

I wrote a little comment in the code review but if this check is the only one that happens (as is currently merged) as far as I can tell writing using the termstore would still work when an item or property has a remote entity source.

Restricted Application added a project: User-Addshore. · View Herald TranscriptJan 28 2020, 12:03 PM

Change 567909 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Wikibase@master] wbterms: disallow using store methods when entities are non local

https://gerrit.wikimedia.org/r/567909

Addshore triaged this task as Medium priority.Jan 28 2020, 12:19 PM

Change 567909 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] wbterms: disallow using store methods when entities are non local

https://gerrit.wikimedia.org/r/567909

Addshore closed this task as Resolved.Feb 3 2020, 9:30 AM