From: Jared Date: Tue, 24 Dec 2013 08:43:42 +0000 (-0800) Subject: Disabled, unticked "Leave redirect" checkbox when redirect impossible X-Git-Tag: 1.31.0-rc.0~17514^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=f8894e8d6bd3a09414b4193632174bfdfa921a3c;p=lhc%2Fweb%2Fwiklou.git Disabled, unticked "Leave redirect" checkbox when redirect impossible Disabled the "Leave redirect" checkbox on Special:MovePage when redirect is impossible because of the content model. Bug: 58017 Change-Id: Ibbc5caace749662d51b9ebd4554234d79b7a887c --- diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 253e6cc37d..9193b5d8e4 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -351,7 +351,16 @@ class MovePageForm extends UnlistedSpecialPage { ); } - if ( $user->isAllowed( 'suppressredirect' ) && $handler->supportsRedirects() ) { + if ( $user->isAllowed( 'suppressredirect' ) ) { + if ( $handler->supportsRedirects() ) { + $isChecked = $this->leaveRedirect; + $options = array(); + } else { + $isChecked = false; + $options = array( + 'disabled' => 'disabled' + ); + } $out->addHTML( " @@ -360,7 +369,8 @@ class MovePageForm extends UnlistedSpecialPage { $this->msg( 'move-leave-redirect' )->text(), 'wpLeaveRedirect', 'wpLeaveRedirect', - $this->leaveRedirect + $isChecked, + $options ) . " "