Last modified: 2013-04-22 16:17:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44639, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42639 - Regression: API action=options cannot enable/disable gadgets
Regression: API action=options cannot enable/disable gadgets
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.21.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Brad Jorsch
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-03 03:53 UTC by Brad Jorsch
Modified: 2013-04-22 16:17 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brad Jorsch 2012-12-03 03:53:36 UTC
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.
Comment 1 Brad Jorsch 2012-12-03 03:55:46 UTC
Gerrit change #36494
Comment 2 Brad Jorsch 2012-12-14 15:53:02 UTC
Change merged.
Comment 3 Rainer Rillke @commons.wikimedia 2013-01-07 00:16:27 UTC
Here is what before a change was possible:

POST
https://commons.wikimedia.org/w/api.php

action	options
format	json
optionname	gadget-Gallerypreview
optionvalue	1
token	XXXXXXXXXXXXXXXXXXXXXXX+\

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. https://commons.wikimedia.org/wiki/MediaWiki:Gadgets-definition

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


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.
Comment 4 Bartosz Dziewoński 2013-01-07 06:08:40 UTC
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.

[1] https://www.mediawiki.org/wiki/MediaWiki_1.21/Roadmap

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links