Page MenuHomePhabricator

"Unexpected entity type item" error when attempting to add Depicts statement on Filepage (in local dev environment)
Closed, ResolvedPublicBug

Description

Steps to Reproduce:
This issue has come up on multiple development instances I've set up (using MW Docker Dev), but I have not encountered it in production.

  1. Import an item into your local Wikibase instance using WikibaseImport. I was attempting to import item Q62, San Francisco.
  2. Attempt to add the item by typing in the Depicts input box until it appears in the dropdown
  3. Click publish

Actual Results:
The panel displays the following error message:

This error also is displayed when attempting to add a Wikibase item that was created locally (not through import script).

Additionally, clicking "Cancel" to leave edit mode does not get the panel out of its broken state; the input field remains greyed out and disabled:

Clicking "Edit" again does not remedy this.

Expected Results:
The statement should publish normally.

Event Timeline

egardner created this task.Apr 23 2019, 9:22 PM
Restricted Application added a project: Multimedia. · View Herald TranscriptApr 23 2019, 9:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
egardner renamed this task from "Unexpected entity type item" error when attempting to add Depicts statement on Filepage to "Unexpected entity type item" error when attempting to add Depicts statement on Filepage (in local dev environment).Apr 23 2019, 9:22 PM

Does any other item work?
I suspect the data type for your depicts property is wrong.
You may need to create a new 'depicts' property (at Special:NewProperty) with data type 'Item', IIRC (and update your LocalSettings.php to use the new depicts property id - I'm not aware of any way of changing an existing property's data type, except for diving into the DB, probably)

egardner added a comment.EditedApr 24 2019, 2:37 PM

That works, thanks – I thought my problem was with the Entity types for some reason, not the type of the depicts Property.
Incidentally, the distinction between Property: type property (what I had defaulted to) and Property: type item is not very clear to me at all.

It would be good to update the README file with information on how to set up local properties correctly as part of T221480.

matthiasmullie added a comment.EditedApr 24 2019, 4:11 PM

That data type refers to the type of "values" that can be associated with the property. So "property" would mean it can have other property (P123) values. "item" means it can have Q123 values.
(I also learned the hard way)

Thanks for clarifying. I've added some info around this in the README for the related ticket at T221480, closing this one.

egardner closed this task as Resolved.Apr 24 2019, 4:33 PM

Assuming this is about WikibaseMediaInfo to allow people to search for related tasks in that codebase.