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
This commit is contained in:
@@ -101,14 +101,17 @@ class Hooks implements
|
|||||||
* Whether ULS Compact interlanguage links enabled
|
* Whether ULS Compact interlanguage links enabled
|
||||||
*
|
*
|
||||||
* @param User $user
|
* @param User $user
|
||||||
|
* @param Skin $skin
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function isCompactLinksEnabled( User $user ) {
|
private function isCompactLinksEnabled( User $user, Skin $skin ) {
|
||||||
// Whether any user visible features are enabled
|
// Whether any user visible features are enabled
|
||||||
if ( !$this->config->get( 'ULSEnable' ) ) {
|
if ( !$this->config->get( 'ULSEnable' ) ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ( $skin->getSkinName() === 'vector-2022' ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if ( $this->config->get( 'ULSCompactLanguageLinksBetaFeature' ) === true &&
|
if ( $this->config->get( 'ULSCompactLanguageLinksBetaFeature' ) === true &&
|
||||||
$this->config->get( 'InterwikiMagic' ) === true &&
|
$this->config->get( 'InterwikiMagic' ) === true &&
|
||||||
$this->config->get( 'HideInterlanguageLinks' ) === false &&
|
$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.
|
// Soft dependency to Wikibase client. Don't enable CLL if links are managed manually.
|
||||||
$excludedLinks = $out->getProperty( 'noexternallanglinks' );
|
$excludedLinks = $out->getProperty( 'noexternallanglinks' );
|
||||||
$override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks );
|
$override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks );
|
||||||
$isCompactLinksEnabled = $this->isCompactLinksEnabled( $out->getUser() );
|
$isCompactLinksEnabled = $this->isCompactLinksEnabled( $out->getUser(), $skin );
|
||||||
$config = [
|
$config = [
|
||||||
'wgULSPosition' => $this->config->get( 'ULSPosition' ),
|
'wgULSPosition' => $this->config->get( 'ULSPosition' ),
|
||||||
'wgULSisCompactLinksEnabled' => $isCompactLinksEnabled,
|
'wgULSisCompactLinksEnabled' => $isCompactLinksEnabled,
|
||||||
|
|||||||
Reference in New Issue
Block a user