From: Thalia Date: Thu, 3 Jan 2019 10:59:20 +0000 (+0000) Subject: Add check for editing restriction widget on Special:Block X-Git-Tag: 1.34.0-rc.0~3151^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=e2e03d0bf145756b61961796b983e4e1b139ba77;p=lhc%2Fweb%2Fwiklou.git Add check for editing restriction widget on Special:Block If partial blocks is not enabled, editing restriction widget will not exist, so check before binding events. Bug: T212808 Change-Id: I33fd7efdc24c026338e25d7c0751d31bc9a7baba --- diff --git a/resources/src/mediawiki.special.block.js b/resources/src/mediawiki.special.block.js index 255b878adf..89bbbc8950 100644 --- a/resources/src/mediawiki.special.block.js +++ b/resources/src/mediawiki.special.block.js @@ -67,7 +67,9 @@ // Bind functions so they're checked whenever stuff changes blockTargetWidget.on( 'change', updateBlockOptions ); expiryWidget.on( 'change', updateBlockOptions ); - editingRestrictionWidget.on( 'change', updateBlockOptions ); + if ( editingRestrictionWidget ) { + editingRestrictionWidget.on( 'change', updateBlockOptions ); + } // Call them now to set initial state (ie. Special:Block/Foobar?wpBlockExpiry=2+hours) updateBlockOptions();