From 3546c62f1907e6cbe7729ef10ab6654f948e54b0 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 26 Sep 2018 16:15:51 -0700 Subject: [PATCH] Drop pre-MW1.32 Special:Preferences (non-OOUI) compatability Depends-On: I65b89385c3ec28ef01b86dd933dae3801e503631 Change-Id: Id9c840e979b723806883bb3e63d7f2f691fea629 --- extension.json | 2 +- includes/OATHAuthHooks.php | 22 ++++++---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/extension.json b/extension.json index c6b58388..1085628e 100644 --- a/extension.json +++ b/extension.json @@ -6,7 +6,7 @@ "descriptionmsg": "oathauth-desc", "type": "other", "requires": { - "MediaWiki": ">= 1.31.0" + "MediaWiki": ">= 1.32.0" }, "license-name": "GPL-2.0-or-later AND GPL-3.0-or-later", "AutoloadClasses": { diff --git a/includes/OATHAuthHooks.php b/includes/OATHAuthHooks.php index 91ae334b..fdc01378 100644 --- a/includes/OATHAuthHooks.php +++ b/includes/OATHAuthHooks.php @@ -122,22 +122,12 @@ class OATHAuthHooks { $msg = $oathUser->getKey() !== null ? 'oathauth-disable' : 'oathauth-enable'; - // TODO: Drop this when isOouiEnabled always returns true. - if ( SpecialPreferences::isOouiEnabled( RequestContext::getMain() ) ) { - $control = new \OOUI\ButtonWidget( [ - 'href' => SpecialPage::getTitleFor( 'OATH' )->getLinkURL( [ - 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText() - ] ), - 'label' => wfMessage( $msg )->text(), - ] ); - } else { - $control = Linker::link( - SpecialPage::getTitleFor( 'OATH' ), - wfMessage( $msg )->escaped(), - [], - [ 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText() ] - ); - } + $control = new \OOUI\ButtonWidget( [ + 'href' => SpecialPage::getTitleFor( 'OATH' )->getLinkURL( [ + 'returnto' => SpecialPage::getTitleFor( 'Preferences' )->getPrefixedText() + ] ), + 'label' => wfMessage( $msg )->text(), + ] ); $preferences[$msg] = [ 'type' => 'info',