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 added a project: MediaWiki-API.Via ConduitNov 22 2014, 1:12 AM
bzimport set Reference to bz42639.
Anomie created this task.Via LegacyDec 3 2012, 3:53 AM
Anomie added a comment.Via ConduitDec 3 2012, 3:55 AM

Gerrit changeset 36494

Anomie added a comment.Via ConduitDec 14 2012, 3:53 PM

Change merged.

Rillke added a comment.Via ConduitJan 7 2013, 12:16 AM

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.

matmarex added a comment.Via ConduitJan 7 2013, 6:08 AM

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

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.