The wbsetitem module seems to be underspecified and exhibits surprising behavior in some cases:
Labels, descriptions and aliases are given per language. For each language given, the labels, descriptions or list of aliases is set, replacing any previous value. If set to an empty value, the respective entry is removed. Language versions of labels, descriptions and aliases that are not present in the posted data structure remain untouched.
That is, it is not possible to completely replace the data of an item without specifying all values for all possible languages. It would be nice to have a flag for "strip other languages" or some such. Maybe that should even be the default.
For Sitelinks, the situation is similar but not quite the same: Site links are set for the sites that are given in the posted data set, links to other sites remain unchanged. Again, it would be nice to have a way to strip links to all sites not specified in the present call to wbsetitem.
But there's one major inconsistency: From looking at the code, it seems that setting the sitelink for a specific site to an empty string does not remove that sitelink, but causes an error. It would be nice if this would change, so the behavior for sitelinks is consistent with how setting of labels/descriptions/aliases work.
For aliases, it might also be nice to have a mode where the new aliases are just added to the existing list - but then, maybe not.
Version: master
Severity: major
Whiteboard: storypoints: 1