wbeditentity removing aliases when used from javascript console
Closed, ResolvedPublic

Description

See http://www.wikidata.org/wiki/MediaWiki_talk:Gadget-Merge.js#aliases_get_removed

When making a request which should in effect be a null edit aliases actually get removed


Version: unspecified
Severity: critical

bzimport added a subscriber: wikidata-bugs.
bzimport set Reference to bz50983.
Addshore created this task.Via LegacyJul 8 2013, 10:16 PM
Addshore added a comment.Via ConduitJul 9 2013, 11:15 AM

After looking a bit further into this it seems 2 out of 4 aliases were removed

Admète (Homonymie) , Admete (homonymie) => Admete (homonymie)
Adméta , Admete => Admete

Something to do with the utf8 chars?

Addshore added a comment.Via ConduitJul 9 2013, 11:26 AM

To reproduce:

  • Load [[Q358687]] and open the js console
  • Post the code below (this essentially gets the json for the entity and then sends it back to the api)

var data = JSON.parse(wbEntity);
data.id = undefined;
data.type = undefined;
data.claims = undefined;
new mw.Api().post({

action: 'wbeditentity',
id: wbEntityId,
data: JSON.stringify(data),
token: mw.user.tokens.get('editToken'),
summary: ''

}).always(function (m, d) { console.log(m, d); })

This should be a null edit but instead removes the 2 aliases listed above.

bzimport added a comment.Via ConduitJul 11 2013, 11:58 AM

nzmoihue wrote:

http://www.wikidata.org/w/index.php?title=Q192439&diff=prev&oldid=55263560 this is more interesting. With this bug every API call to wbeditentity is going to a data loss on Wikidata but...

gerritbot added a comment.Via ConduitJul 11 2013, 6:30 PM

Change 73204 had a related patch set uploaded by Aude:
(bug 50983) Fix set aliases in EditEntity api module

https://gerrit.wikimedia.org/r/73204

gerritbot added a comment.Via ConduitJul 11 2013, 7:48 PM

Change 73204 merged by Addshore:
(bug 50983) Fix set aliases in EditEntity api module

https://gerrit.wikimedia.org/r/73204

aude added a comment.Via ConduitJul 11 2013, 8:21 PM

this is deployed now.

gerritbot added a comment.Via ConduitJul 11 2013, 8:23 PM

Change 73322 had a related patch set uploaded by Aude:
(bug 50983) Fix set aliases in EditEntity api module

https://gerrit.wikimedia.org/r/73322

gerritbot added a comment.Via ConduitJul 11 2013, 8:26 PM

Change 73322 merged by Addshore:
(bug 50983) Fix set aliases in EditEntity api module

https://gerrit.wikimedia.org/r/73322

Abraham added a comment.Via ConduitJul 17 2013, 2:29 PM

Verified in Wikidata demo time July 27th

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.