Fix account create checkbox bug
authorDayllan Maza <dmaza@wikimedia.org>
Tue, 12 Mar 2019 16:42:03 +0000 (12:42 -0400)
committerDayllan Maza <dmaza@wikimedia.org>
Thu, 21 Mar 2019 03:28:33 +0000 (23:28 -0400)
commitb20e49709ff3094c99802d997d4f5a7e44d39137
tree9cc7b53b38dcfe450e316ce8978c468004fd7773
parent5a2e5db4fcbdd18128c62200ffabbeb652850203
Fix account create checkbox bug

When a block is being created on Special:Block, the "create account"
checkbox is checked by default if the block is set to "Sitewide" and
unchecked by default if the block is set to "partial".

There are multiple scenarios where the checkbox should not check and
uncheck according to the type of block.
1.- When editing a block. This means that an admin already saved the
    the block so we shouldn't mess with the options
2.- After posting the form. An admin was ready to save and it didn't
    happen for whatever reason. Still we shouldn't mess with the options
3.- After manually clicking the checkbox itself (already working before
    this patch)

Bug: T216845
Change-Id: I39b723d1f638d016c74ec20639efeecac95d8cdd
includes/specials/SpecialBlock.php
resources/src/mediawiki.special.block.js