From b5aff8a06b6bf4595e7fe75b36364779f4144460 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 9 Jun 2020 16:37:42 -0700 Subject: [PATCH] Define unsupported skins Previously UniversalLanguageSelector relied on the targets system meaning the modules ext.uls.interface, ext.uls.interlanguage and ext.uls.pt were loaded on Minerva desktop skin unnecessarily and silently removed on MobileFrontend which throws a warning. Instead of doing this, check the skin Bug: T237036 Bug: T235712 Change-Id: Ib38b041533cf959c3c4c30decc65869995c254fa --- extension.json | 8 ++++++++ includes/UniversalLanguageSelectorHooks.php | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/extension.json b/extension.json index 4692ea4f..4d78d8d7 100644 --- a/extension.json +++ b/extension.json @@ -242,6 +242,7 @@ "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.interface": { + "targets": [ "desktop", "mobile" ], "scripts": "js/ext.uls.interface.js", "styles": "css/ext.uls.interface.less", "dependencies": [ @@ -261,6 +262,7 @@ "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.interlanguage": { + "targets": [ "desktop", "mobile" ], "styles": "css/ext.uls.interlanguage.less", "localBasePath": "resources", "remoteExtPath": "UniversalLanguageSelector/resources" @@ -304,6 +306,10 @@ "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.preferences": { + "targets": [ + "desktop", + "mobile" + ], "scripts": "js/ext.uls.preferences.js", "dependencies": [ "mediawiki.user", @@ -318,6 +324,7 @@ "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.pt": { + "targets": [ "desktop", "mobile" ], "styles": "css/ext.uls.pt.less", "localBasePath": "resources", "skinStyles": { @@ -326,6 +333,7 @@ "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.webfonts": { + "targets": [ "desktop", "mobile" ], "scripts": "js/ext.uls.webfonts.js", "dependencies": [ "ext.uls.common", diff --git a/includes/UniversalLanguageSelectorHooks.php b/includes/UniversalLanguageSelectorHooks.php index 647a401d..868491a2 100644 --- a/includes/UniversalLanguageSelectorHooks.php +++ b/includes/UniversalLanguageSelectorHooks.php @@ -116,8 +116,12 @@ class UniversalLanguageSelectorHooks { * @param Skin $skin * Hook: BeforePageDisplay */ - public static function addModules( OutputPage $out, $skin ) { + public static function addModules( OutputPage $out, Skin $skin ) { global $wgULSPosition, $wgULSGeoService; + $unsupportedSkins = [ 'minerva' ]; + if ( in_array( $skin->getSkinName(), $unsupportedSkins ) ) { + return; + } // Soft dependency to Wikibase client. Don't enable CLL if links are managed manually. $excludedLinks = $out->getProperty( 'noexternallanglinks' );