mw.api.saveOption() should stringify bools in PHP style, not JS style
Open, LowPublic


$user->setOption('userjs-bar', true); $user->saveSettings(); stores the string "1", but (new mw.Api()).saveOption('userjs-foo', true); stores the string "true". This appears to be because (string)true is "1" in PHP, but in JavaScript String(true) is "true". mw.Api should be cleverer and stringify non-string preference values to what PHP would stringify them to, so the JS and PHP APIs are consistent in terms of what they end up storing in the DB.

Catrope created this task.Jun 3 2015, 10:41 PM
Catrope updated the task description. (Show Details)
Catrope raised the priority of this task from to Needs Triage.
Catrope added projects: MediaWiki-API, JavaScript.
Catrope added a subscriber: Catrope.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 3 2015, 10:41 PM
Forrestbot set Security to None.Jun 4 2015, 3:04 PM
Forrestbot added a subscriber: matmarex.
Legoktm added a subscriber: Legoktm.Jun 4 2015, 9:50 PM

Forrestbot added a subscriber: matmarex.

Err, oops. That was me logged into the forrestbot account.

Aklapper triaged this task as Low priority.Jul 17 2015, 1:06 PM