From 5d2bc68da1eb3df41bfcd9d346dad467f0fa99ee Mon Sep 17 00:00:00 2001 From: Clare Ming Date: Mon, 31 Jan 2022 09:43:15 -0700 Subject: [PATCH] Don't show language alert on main page if it has no languages Bug: T299581 Change-Id: Idc5b702626249ebec5d627e7b88fd6adf3e3750a --- includes/SkinVector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/SkinVector.php b/includes/SkinVector.php index 2ac378d01..77198c087 100644 --- a/includes/SkinVector.php +++ b/includes/SkinVector.php @@ -558,7 +558,7 @@ class SkinVector extends SkinMustache { private function shouldLanguageAlertBeInSidebar(): bool { $featureManager = VectorServices::getFeatureManager(); $isMainPage = $this->getTitle() ? $this->getTitle()->isMainPage() : false; - $shouldShowOnMainPage = $isMainPage && + $shouldShowOnMainPage = $isMainPage && !empty( $this->getLanguagesCached() ) && $featureManager->isFeatureEnabled( Constants::FEATURE_LANGUAGE_IN_MAIN_PAGE_HEADER ); return ( $this->isLanguagesInContentAt( 'top' ) && !$isMainPage && $featureManager->isFeatureEnabled( Constants::FEATURE_LANGUAGE_ALERT_IN_SIDEBAR ) ) ||