Last modified: 2011-11-09 17:37:10 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 T32909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30909 - URL parameters for checkboxes in Special:Block no longer work
URL parameters for checkboxes in Special:Block no longer work
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User blocking (Other open bugs)
1.20.x
All All
: High normal (vote)
: 1.18.0 release
Assigned To: Antoine "hashar" Musso (WMF)
: patch, patch-need-review
: 31273 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-15 08:00 UTC by Michael M.
Modified: 2011-11-09 17:37 UTC (History)
8 users (show)

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


Attachments
Patch to use the request-supplied value for checkbox variables (571 bytes, patch)
2011-10-10 18:52 UTC, Brad Jorsch
Details

Description Michael M. 2011-09-15 08:00:17 UTC
Using URL parameters to (un)check the checkboxes on Special:Block no longer works. In 1.17 and before URLs like /wiki/Special:Block/127.0.0.1?wpWatchUser=1 etc. used to work, i. e. the checkbox was checked when the page was opened. (I didn't test this myself, but an admin on de.wikipedia told me that it works.)
This worked for wpAnonOnly, wpCreateAccount, wpEnableAutoblock, wpEmailBan, wpWatchUser, wpAllowUsertalk.
While I am still able to fill the inputs for the text (expiry, reason) I can't find a way for the checkboxes, neither in 1.18 (tested in a wiki I installed from trunk a few days before the re-branch) nor in the current trunk.
Comment 1 db [inactive,noenotif] 2011-09-17 17:44:52 UTC
HTMLTextField has no own loadDataFromRequest

HTMLCheckField has a own loadDataFromRequest and is checking there against the method of the form (r84814), but that is always 'post' and so the values from the request are not used.

Setting $form->setMethod( 'get' ); in SpecialBlock.php fixed this, but than also a validation of the input fields is done on 'get' and the special page shows a error at the first visit.
Comment 2 Happy-melon 2011-09-18 20:38:52 UTC
(In reply to comment #1)
> Setting $form->setMethod( 'get' ); in SpecialBlock.php fixed this, but than
> also a validation of the input fields is done on 'get' and the special page
> shows a error at the first visit.

And more importantly would submit the form via a GET request, which has a variety of negative security implications.
Comment 3 db [inactive,noenotif] 2011-09-30 19:15:02 UTC
*** Bug 31273 has been marked as a duplicate of this bug. ***
Comment 4 Brad Jorsch 2011-10-10 18:52:36 UTC
Created attachment 9210 [details]
Patch to use the request-supplied value for checkbox variables

Right now, HTMLCheckField guesses if the form is being submitted (i.e. it's a method="GET" form or it supplies wpEditToken). If not, it completely ignores the request-supplied value in favor of the form's default.

Perhaps the thing to do is to always use the request-supplied value any time there is one, as well as when it thinks the form is being submitted. This should result in the appropriate logic for forms such as Special:Block: ?wpWatch=1 forces the checkbox on, ?wpWatch=0 forces it off, and not specifying wpWatch at all gives the form default.
Comment 5 Antoine "hashar" Musso (WMF) 2011-10-31 22:59:37 UTC
bug 31770 most probably has the same root cause.
Comment 6 Antoine "hashar" Musso (WMF) 2011-11-01 09:29:35 UTC
Patched with r101464 pending code review.
Will need to be merged back to REL1_18.
Comment 7 Antoine "hashar" Musso (WMF) 2011-11-01 10:16:35 UTC
*** Bug 31851 has been marked as a duplicate of this bug. ***
Comment 8 Antoine "hashar" Musso (WMF) 2011-11-08 15:59:35 UTC
Marking this one as resolved. Pending merge to 1.18 for tarball release.
Comment 9 Antoine "hashar" Musso (WMF) 2011-11-09 17:37:10 UTC
merged in 1.18 by r102533

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


Navigation
Links