Watchlist: Fix form and preference overriding
authorMatthew Flaschen <mflaschen@wikimedia.org>
Fri, 17 Mar 2017 22:33:12 +0000 (18:33 -0400)
committerJforrester <jforrester@wikimedia.org>
Sat, 18 Mar 2017 01:04:57 +0000 (01:04 +0000)
commitbc18aa06773bbb874540569aef7f530ad51013bf
tree069c45ca4397b9469261b710f2b05d48dbefe6ff
parent16ee5a77560ac9f201582363c4e493b1002bb5cb
Watchlist: Fix form and preference overriding

Fix a regression caused by aa063f4c5a19.  Restore the behavior
where:

* Without action=submit: Boolean preferences apply to the displayed form and its
  results, but they can be overriden by the query string.
* With action=submit: Only boolean parameters in the query string apply;
  preferences are not considered.

  (However, boolean preferences not on the form, i.e. 'extended', still
  always apply.)

This behavior is a consequence of how checkboxes work in HTML; only
checked boxes are sent to the server.

Bug: T160734
Change-Id: Ic050dd1445ade9449496bb051f04ca0a87b8b5d7
includes/specials/SpecialWatchlist.php
tests/phpunit/includes/specials/SpecialWatchlistTest.php