RCFilters: Actually be consistent when storing 'highlight' state
authorMoriel Schottlender <moriel@gmail.com>
Mon, 15 May 2017 19:10:07 +0000 (12:10 -0700)
committerCatrope <roan@wikimedia.org>
Mon, 15 May 2017 19:46:12 +0000 (19:46 +0000)
commit930f8f7a4ac2f5f7559f50484f8a06e81b854df8
treed80d8e69cfa2f38863ddbcd465712089e7a9452f
parent6f875daf49bc131844255d597f9a616e247e18a6
RCFilters: Actually be consistent when storing 'highlight' state

Saved queries are storing *filter* definitions, not parameters, so
highlight state (dictating whether highlights are enabled) are supposed
to be stored as boolean.

A previous fix that was meant to make sure we store and handle all
*parameters* as strings '0' and '1' was a bit overzealous, and stored
highlight state in saved queries as '1' and '0' too. The current state
then compared that to the filter-state, which produces false/true.

This resulting in saved queries only being matched to the current
state as never true, because the comparison goes by actual obejct
key-values, not symbolic values.

Bug: T165381
Change-Id: Ifdec3a8c058a0e004304e48a857c58639928b36f
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js