Regression: API action=options cannot enable/disable gadgets
Closed, ResolvedPublic


After change I98df55f2 from bug 42202, the API's action=options can no longer change the preferences for which gadgets are enabled, or anything else that uses a "multiselect" HTMLForm element.

The problem is that these multiselect elements are stored in the user preferences table by storing one key with a boolean value for each option in the multiselect, but the validation code added does not take this into account and therefore considers all of these option keys invalid.

Gerrit changeset to be posted shortly.

Version: 1.21.x
Severity: normal


bzimport set Reference to bz42639.
Anomie created this task.Dec 3 2012, 3:53 AM
Anomie added a comment.Dec 3 2012, 3:55 AM

Gerrit changeset 36494

Change merged.

Here is what before a change was possible:


action options
format json
optionname gadget-Gallerypreview
optionvalue 1

But the response is now:

{"warnings":{"options":{"*":"Not a valid preference: gadget-Gallerypreview"}},"options":"success"}

At Commons there is a gadget named "Gallerypreview". c.f.

The same happens when attempting to disable a gadget:
action options
format json
optionname gadget-Slideshow
optionvalue 0

Is this deployed yet?

Aside from that, it shouldn't return "success"... Nothing is changed because it couldn't find the key so it's an error.

Not yet deployed: this was merged on December 14th, so per the Roadmap[1] didn't make it into wmf6. It did make it into wmf7 AFAIK, which is due to be deployed on Commons today.


(WMF switched for a three-week deployment cycle for wmf6 and wmf7 due to the holidays.)

Add Comment