From 8a555287724e36c8af24cc41d0cb8baf83c1765a Mon Sep 17 00:00:00 2001 From: NikG Date: Tue, 1 Nov 2022 09:09:29 +0200 Subject: [PATCH] Compact language list preference should be ignored for Vector 2022 skin The Compact language list preference was intended to control whether to show all languages directly or show just a few of them (with option to search for the rest) instead. However, with the new Vector 2022 skin, there is only a button to access language selection and thus, this setting should be ignored for this skin. This patch modifies the "isCompactLinksEnabled" method inside Hooks to always return true when the skin is set to Vector 2022 (when ULS features are enabled). Bug: T319690 Change-Id: Ic8a537d31ee4dad02932a04017f19537140e0c1c --- includes/Hooks.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 019d0891..326b9f92 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -101,14 +101,17 @@ class Hooks implements * Whether ULS Compact interlanguage links enabled * * @param User $user + * @param Skin $skin * @return bool */ - private function isCompactLinksEnabled( User $user ) { + private function isCompactLinksEnabled( User $user, Skin $skin ) { // Whether any user visible features are enabled if ( !$this->config->get( 'ULSEnable' ) ) { return false; } - + if ( $skin->getSkinName() === 'vector-2022' ) { + return true; + } if ( $this->config->get( 'ULSCompactLanguageLinksBetaFeature' ) === true && $this->config->get( 'InterwikiMagic' ) === true && $this->config->get( 'HideInterlanguageLinks' ) === false && @@ -143,7 +146,7 @@ class Hooks implements // Soft dependency to Wikibase client. Don't enable CLL if links are managed manually. $excludedLinks = $out->getProperty( 'noexternallanglinks' ); $override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks ); - $isCompactLinksEnabled = $this->isCompactLinksEnabled( $out->getUser() ); + $isCompactLinksEnabled = $this->isCompactLinksEnabled( $out->getUser(), $skin ); $config = [ 'wgULSPosition' => $this->config->get( 'ULSPosition' ), 'wgULSisCompactLinksEnabled' => $isCompactLinksEnabled,