Page MenuHomePhabricator

Account creation checkbox inappropriately checked at Special:Block/<Username>
Closed, ResolvedPublic2 Estimated Story Points

Description

Since T208510, the "Account creation" checkbox on the Special:Block page becomes unchecked if the block type is set to partial, and checked if it is set to sitewide (unless a user has already interacted with the checkbox, in which case it doesn't change).

This also happens on the Special:Block/<Username> page: if <Username> has been partial blocked, with the "Account creation" checkbox checked, the checkbox unchecks itself because the block is partial. Similarly, if the block is sitewide, with the "Account creation" checkbox unchecked, the checkbox checks itself on Special:Block/<Username> because the block is sitewide. This should not happen: the form should reflect the block.

Event Timeline

Whoops... sorry I forgot to check that.

dmaza moved this task from Cards ready for development to He — ה on the Anti-Harassment board.
dmaza edited projects, added Anti-Harassment (He — ה); removed Anti-Harassment.
dmaza moved this task from Ready to In progress on the Anti-Harassment (He — ה) board.

Change 495933 had a related patch set uploaded (by Dmaza; owner: Dmaza):
[mediawiki/core@master] Fix account create checkbox bug

https://gerrit.wikimedia.org/r/495933

Change 495933 merged by jenkins-bot:
[mediawiki/core@master] Fix account create checkbox bug

https://gerrit.wikimedia.org/r/495933

dom_walden added a subscriber: Niharika.

As described in the commit, when editing a preexisting block or if posting of the Special:Block form failed (i.e. validation issues), the account creation checkbox will not change when switching from sitewide to partial (or vice versa).

I could not think of any conditions other than these two to test.

Prexisting block

For cases where the block already existed, I edited at various preexisting blocks to check that a) the form pre-populated with correct parameters and b) the account creation checkbox did not change on switching between sitewide and partial.

I repeated some of this with JS disabled and on IE8 and IE11. Although the change is mainly server-side, I notice a difference in HTML attributes between JS and no-JS. But, this did not seem to affect the behaviour.

Failed form POST

For failed form posting, I submitted the form with various invalid input. Afterwards, I checked that the value of the checkbox had not been changed and did not change switching from sitewide to partial (or vice versa).

I also attempted to create a new block of a user who was already blocked (both posted form and preexisting block). Behaves the same as an invalid form, and the input fields are not changed from what you attempted to post.

Again, repeated without JS, but didn't make a difference.

Testing for regressions

I briefly retested changes from T208510, that after interacting with the account creation checkbox switching from partial to sitewide (or vice versa) does not change the checkbox, just in case of regressions.

I also created and edited a few blocks to check that the block parameters are being set properly (e.g. there is nothing wrong with the Special:Block form).

Possible issue

The only possible regression (and I think this pre-dates this particular change, as the same thing happens on test) is that the URL parameter "wpCreateAccount" is not effective.

For example, setting it to "0" does not make the "Account creation" checkbox unticked:
https://en.wikipedia.beta.wmflabs.org/wiki/Special:Block?wpCreateAccount=0

It behaves correctly for other form fields, such as "Block email":
https://en.wikipedia.beta.wmflabs.org/wiki/Special:Block?wpDisableEmail=1

@Niharika Would you like a separate bug raised for this?

Environments:

https://en.wikipedia.beta.wmflabs.org (sorry I did not record the version and it has since changed).

Local VM MediaWiki 1.33.0-alpha (2d78318) 06:13, 22 March 2019.

Thanks @dom_walden and @Tchanders. Let's estimate that bug in next estimation.
I think this ticket can be closed now. Reopen if I misunderstood.