jenkins-bot has submitted this change and it was merged. Change subject: handle local interwiki links as appropriate for site group ......................................................................
handle local interwiki links as appropriate for site group Change-Id: Ibf68d1e8f4eca983e63c6551131086ca69fe026d --- M client/includes/LangLinkHandler.php 1 file changed, 8 insertions(+), 10 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/LangLinkHandler.php b/client/includes/LangLinkHandler.php index 316738a..646115d 100644 --- a/client/includes/LangLinkHandler.php +++ b/client/includes/LangLinkHandler.php @@ -285,21 +285,19 @@ wfProfileIn( __METHOD__ ); //FIXME: this needs to be moved into core, into SiteList resp. SiteArray! - if ( $this->sitesByNavigationId === null ) { - $this->sitesByNavigationId = array(); + $allSites = $this->sites->getSites(); + $groupSites = $allSites->getGroup( Settings::get( 'siteGroup' ) ); - /* @var Site $site */ - foreach ( $this->sites->getSites() as $site ) { - $ids = $site->getNavigationIds(); - - foreach ( $ids as $navId ) { - $this->sitesByNavigationId[$navId] = $site; - } + /* @var Site $site */ + foreach ( $groupSites as $site ) { + if ( $site->getLanguageCode() === $id ) { + wfProfileOut( __METHOD__ ); + return $site; } } wfProfileOut( __METHOD__ ); - return isset( $this->sitesByNavigationId[$id] ) ? $this->sitesByNavigationId[$id] : false; + return false; } /** -- To view, visit https://gerrit.wikimedia.org/r/80210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf68d1e8f4eca983e63c6551131086ca69fe026d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.22-wmf14 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits