matej_suchanek created this task.
matej_suchanek added projects: Pywikibot-core, Pywikibot-Wikidata.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

(Actually, it does but that doesn't work.)

If you want remove a label or description, you can run

item.labels['en'] = ''
item.descriptions['en'] = ''
item.editEntity()

or

item.labels.pop('en')
item.descriptions.pop('en')
item.editEntity()

or

data = {'labels': {'en': ''}, 'descriptions': {'en': ''}}
item.editEntity(data)

However, if you want to remove an alias / aliases, you must provide data with accordance to change-op-serializations.wiki (which isn't really convenient):

data = {'aliases': [{'language': lang, 'value': alias, 'remove': ''} for alias in aliases]}
item.editEntity(data)

If you manipulate with attributes (like in the first two examples), you will get API error modification-failed: Must be at least one character long because Pywikibot fills the changed fields with empty strings (since they are rejected, this is wrong behavior).


TASK DETAIL
https://phabricator.wikimedia.org/T194512

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: matej_suchanek
Cc: Aklapper, matej_suchanek, pywikibot-bugs-list, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, jayvdb, Ricordisamoa, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to