Last modified: 2013-01-14 16:15:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45317, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43317 - jQuery.entityselector widget returns wrong selected entity information (label set to ID if no label)
jQuery.entityselector widget returns wrong selected entity information (label...
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-21 13:28 UTC by Daniel A. R. Werner
Modified: 2013-01-14 16:15 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel A. R. Werner 2012-12-21 13:28:05 UTC
The Object representing the selected entity selected within a jQuery.entityselector contains wrong information. The label field of the object contains the entity's ID in case there is no label defined. This is simply wrong and falsifies the entity cache on the JS-client side which we update with the entityselector's information. This will result in PVSnaks using items not being displayed pretty/consistent in case the selected item has no label.
Comment 1 Daniel A. R. Werner 2012-12-21 13:30:59 UTC
The root of the problem must be in jquery.ui.entityselector.js, '_success' function, line 240 with "response.search[i].value = response.search[i].id"

This is very weird because the .value was just for entityselector internals as far as I can remember. i can't see the .label being touched anywhere. Perhaps its a jQuery.suggester thing.
Comment 2 Henning 2012-12-23 16:46:30 UTC
Although one might have a different view point towards what is described as "simply wrong", https://gerrit.wikimedia.org/r/#/c/39853/ should fix the problem.
Comment 3 Daniel A. R. Werner 2012-12-25 03:28:27 UTC
Thanks, I will test this soon!

Don't think one could argue against "Simply Wrong" about this being a bug currently. At least not without being wrong OR changing existing documentation which would then require non-trivial changes downstream (wb.entities etc.).
After all, an Object representing an entity in JS shouldn't be smart or give you different information than the one on the server, UNLESS the documentation will explain and warn you about it. And yes, then you can argue about it all night long by having different point of views.
Comment 4 abraham.taherivand 2013-01-14 16:15:46 UTC
Verified in Wikidata demo sprint 28

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links