Page MenuHomePhabricator

Handling of mismatch between Snak's value's data value type and Snak's property's data type's data value type
Closed, ResolvedPublic

Description

If for some reason a mismatch between Snak's value's data value type and Snak's property's data type's data value type appears in the defined Snaks of a page, this will cause JavaScript errors in the snakview.

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.


Version: unspecified
Severity: normal
Whiteboard: Storypoints: 5

Details

Reference
bz44014

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:17 AM
bzimport set Reference to bz44014.
bzimport added a subscriber: Unknown Object (MLST).

wikidata-bugs wrote:

Change I0c3bfa2d: (bug 44014) Handling of changed data types

Verified in Wikidata demo sprint 29

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