Page MenuHomePhabricator

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

Details

Reference
bz50983

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 2:00 AM
bzimport set Reference to bz50983.
bzimport added a subscriber: Unknown Object (MLST).

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?

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.

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...

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

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

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

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

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

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

Verified in Wikidata demo time July 27th