Page MenuHomePhabricator

TypeError in Wikibase\Repo\Merge\Validator\NoCrossReferencingStatements::validate()
Closed, InvalidPublic

Description

Requests to merge two items on my local Wikibase instance all fail with a TypeError:

2019-09-14 16:06:07 0980d124a795 wikibase: [a775be84fa95eeec070cade6] /wiki/Special:MergeItems   TypeError from line 25 of /var/www/html/extensions/Wikibase/repo/includes/Merge/Validator/NoCrossReferencingStatements.php: Argument 1 passed to Wikibase\Repo\Merge\Validator\NoCrossReferencingStatements::validate() must be an instance of Wikibase\DataModel\Entity\StatementListProvidingEntity, instance of Wikibase\DataModel\Entity\Item given, called in /var/www/html/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpsMerge.php on line 315

Versions:

wikibase-docker commit ce639ab (+ some customization of docker-compose.yml and LocalSettings.php, but that shouldn't have an influence here)

WikibaseClient  – (9344529) 23 mars 2019 à 09:24
WikibaseLib – (9344529) 23 mars 2019 à 09:24
WikibaseRepository  – (9344529) 23 mars 2019 à 09:24
WikibaseView  – (9344529) 23 mars 2019 à 09:24

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Could you send a copy of your composer.lock please? (or just which version of wikibase datamodel is installed)

Looking at master https://github.com/wmde/WikibaseDataModel/blob/master/src/Entity/Item.php does implement StatementListProvidingEntity

the composer.lock I found in /var/www/html/extensions/Wikibase

Are you not using the composer merge plugin?
I just noticed that the docker images don't do use this yet and filed T233490.

That composer.lock states:

"name": "wikibase/data-model",
"version": "9.1.0",

Looking at the code for 9.1.0 the Item class looks fine
https://github.com/wmde/WikibaseDataModel/blob/396358d91ccd2bd52ebd93e84cfab5e3ba4306b2/src/Entity/Item.php#L29

Its possible that another version of the data-model library is being loaded from somewhere as the composer merge plugin is not being used.

What other extensions do you have? And if they are installed using composer what versions of wikibase/data-model do they state in their composer.lock files?

I don't know if I am or not using the composer merge plugin, I'm using the wikibase/wikibase:1.33-bundle docker image without any additional extension

reverting to wikibase/wikibase:1.32-bundle seems to solves the issue, so that would make the suspect change be somewhere between cd41afd and 9344529

could you tell more on that merge plugin? what is it (found it), where is it referenced and used?

So the plugin is used when installing the composer deps of mediawiki.
The plugin looks for deps needed by extensions and skins (depending on configuration) and installs them all.

https://github.com/wikimedia/mediawiki-extensions-Wikibase/compare/cd41afdefa4b03a80b07cb80825eeedd294c8c74...9344529a84e547d844de3864c14a672f5be5b00b wont show me all of the commits to try and find it :(

https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/edb397bfa7712c219419823a899dd7a81de226fd and https://gerrit.wikimedia.org/g/mediawiki/extensions/Wikibase/+/804017a73b0789b7bd7ecb27320a818f834cd667 vaugly relate to this same issue I think.

T233490 should be the solution here, so I'll close this one now? :)