Page MenuHomePhabricator

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


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:

Screen Shot 2019-04-23 at 2.13.51 PM.png (572×1 px, 96 KB)

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:

Screen Shot 2019-04-23 at 2.19.43 PM.png (418×1 px, 66 KB)

Clicking "Edit" again does not remedy this.

Expected Results:
The statement should publish normally.

Event Timeline

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)

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.

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.

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