From: Thalia Date: Wed, 22 May 2019 21:47:54 +0000 (+0100) Subject: Fix user talk checkbox enabling/disabling on Special:Block X-Git-Tag: 1.34.0-rc.0~1605^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=8e684bd52f8bc3be8857c26a5d2846ed5d9be30a;p=lhc%2Fweb%2Fwiklou.git Fix user talk checkbox enabling/disabling on Special:Block Partial blocks ignore the ipb_allow_usertalk field, so the user talk checkbox should be disabled on Special:Block when creating a partial block. The checkbox is already disabled for partial blocks against editing. This also disables the checkbox for partial blocks that do not involve editing. Bug: T224032 Change-Id: I2519ab30a90872d90f05861c65ab943d7937d9fa --- diff --git a/resources/src/mediawiki.special.block.js b/resources/src/mediawiki.special.block.js index 58657dbd3e..6d003aa5bc 100644 --- a/resources/src/mediawiki.special.block.js +++ b/resources/src/mediawiki.special.block.js @@ -59,14 +59,17 @@ pageRestrictionsWidget.setDisabled( !editingIsSelected || isSitewide ); namespaceRestrictionsWidget.setDisabled( !editingIsSelected || isSitewide ); if ( blockAllowsUTEdit ) { - // This option is disabled for partial blocks unless a namespace restriction - // for the User_talk namespace is in place. + // Disable for partial blocks, unless the block is against the User_talk namespace preventTalkPageEditWidget.setDisabled( - editingIsSelected && - editingRestrictionValue === 'partial' && - namespaceRestrictionsWidget.getValue().indexOf( - String( mw.config.get( 'wgNamespaceIds' ).user_talk ) - ) === -1 + // Partial block that doesn't block editing + !editingIsSelected || + // Partial block that blocks editing and doesn't block the User_talk namespace + ( + editingRestrictionValue === 'partial' && + namespaceRestrictionsWidget.getValue().indexOf( + String( mw.config.get( 'wgNamespaceIds' ).user_talk ) + ) === -1 + ) ); } }