checkbox could not be checked through URL parameter
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 09:28:51 +0000 (09:28 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 1 Nov 2011 09:28:51 +0000 (09:28 +0000)
commit1debab271ecdbedf7a88bfd707825a6e8b6a8543
tree68a8e09e5de30fc889b6bfa7dbe2e3254d8eb34e
parent39ece40f466e7a9c3e9000c65533c7ddb772e60d
checkbox could not be checked through URL parameter

On [[Special:EmailUser]], someone ought to be able to pass the checkboxes
names to overrides the default. As an example from bug 31770, the email
user page has a checkbox wpCCMe which let the user as for a copy of the
email being send. This is a user preference.

One change that checkbox state by appending ?wpCCMe=<boolean> ie:
Special:EmailUser/Hashar?wpCCMe=0
Special:EmailUser/Hashar?wpCCMe=1

The logic added in r84814 could have allowed checkboxes to be overriden
for GET form. Unfortunately, HTMLForm is mostly with the default POST.
Hence, when appending the query parameter, we would never honor it!

The fix is to still unconditionally look at the value if the form was
correctly submitted (ie has wpEditToken) and additionaly whenever
there is a checkbox name appearing in the query (wherever it is false
or true, hence the use of getVal()).

This is a regression in REL1_18.  I dont think it deserves a release notes
since it is not fixing anything compared to 1.17.

Bug fixed:
==========
* (bug 31770) Allow URL parameter wpCCMe on Special:EmailUser
* (bug 30909) URL parameters for checkboxes in Special:Block no longer work
includes/HTMLForm.php