This should be handled by displaying a message instead. This can happen for various reasons, e.g.:
- A property's data type has been changed
- A data type definition has changed (in the PHP code) and uses a different data value type now
- Someone (e.g. gadget developer) sets such an unfitting data value to the jQuery.wikibase.valueview widget directly.
I just ran into this when we internally changed the wikibase-item data type to use the new entity ID data value instead of the String data value.
When we are in production, changes like this would require some script to convert all of the old data values to data value of the new data value type. For displaying stuff nicely in the meantime and in case there is not such script or in case an admin had to change a property's data type for some reason, we should just prevent the JS from failing and display some simple message. Perhaps even display the value but with a message on top and when clicking edit, the right valueview widget for insertion of a value of the right data value type.
Whiteboard: Storypoints: 5