Last modified: 2014-08-07 19:24:42 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 T65080, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63080 - cannot reset skin preferences to default with api action=options
cannot reset skin preferences to default with api action=options
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-25 17:49 UTC by Umherirrender
Modified: 2014-08-07 19:24 UTC (History)
5 users (show)

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


Attachments

Description Umherirrender 2014-03-25 17:49:10 UTC
api action=options has a documentated feature:
"If no value is given (not even an equals sign), the option will be reset to its default value"

But the query api.php?action=options&change=skin&token= will give "Validation error for 'skin': ", because HTMLRadioField::validate will return false on the given null value and that false is converted to a empty string. When it will return true, the null is passed to User::setOption and than gets it default value, which is okay.
Comment 1 Brad Jorsch 2014-03-26 15:28:39 UTC
When not passed a value to set the option to, ApiOptions should either skip the validation attempt (relying on $user->setOption to handle null properly) or should fetch the default itself from User::getDefaultOption.

The former seems slightly easier, while the latter seems slightly cleaner. I don't see a whole lot of reason to prefer either way.
Comment 2 Gerrit Notification Bot 2014-04-02 18:57:49 UTC
Change 123367 had a related patch set uploaded by Konarak:
Handle defaults for api action=options

https://gerrit.wikimedia.org/r/123367

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


Navigation
Links