Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/204255
Change subject: Remove debug code from LangLinkHandler ...................................................................... Remove debug code from LangLinkHandler I never see these warnings in the logs. Only time they might occur is when enabling Wikibase / sites table somewhere or creating a new wiki. In those cases, the warnings are not necessary. For enabling Wikibase, we usually add and populate the sites table before enabling the extension, and thus get no warnings. If adding a new wiki, maybe it's the other way around but is being worked on and the warnings are not needed. Change-Id: Ib6ec4f0482e1e7bd4a694ce7867b830d1e8de4fd --- M client/includes/LangLinkHandler.php 1 file changed, 1 insertion(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/55/204255/1 diff --git a/client/includes/LangLinkHandler.php b/client/includes/LangLinkHandler.php index af2c8a0..cfe18d5 100644 --- a/client/includes/LangLinkHandler.php +++ b/client/includes/LangLinkHandler.php @@ -113,36 +113,23 @@ * @return SiteLink[] A map of SiteLinks, indexed by global site id. */ public function getEntityLinks( Title $title ) { - wfDebugLog( __CLASS__, __FUNCTION__ . ": Looking for sitelinks defined by the " - . "corresponding item on the wikibase repo." ); - $links = array(); $itemId = $this->getItemIdForTitle( $title ); if ( $itemId !== null ) { - wfDebugLog( __CLASS__, __FUNCTION__ . ': Item ID for ' . $title->getFullText() - . ' is ' . $itemId->getSerialization() ); - //NOTE: SiteLinks we could get from $this->siteLinkLookup do not contain badges, // so we have to fetch the links from the Item. /* @var Item $item */ + $itemId = new ItemId( 'Q38295' ); $item = $this->entityLookup->getEntity( $itemId ); if ( $item ) { $links = iterator_to_array( $item->getSiteLinkList() ); $links = $this->indexLinksBySiteId( $links ); - } else { - wfWarn( __METHOD__ . ": Could not load item " . $itemId->getSerialization() - . " for " . $title->getFullText() ); } - } else { - wfDebugLog( __CLASS__, __FUNCTION__ . ": No corresponding item found for " - . $title->getFullText() ); } - - wfDebugLog( __CLASS__, __FUNCTION__ . ": Found " . count( $links ) . " links." ); return $links; } @@ -273,8 +260,6 @@ public function filterRepoLinksByGroup( array $repoLinks, array $allowedGroups ) { foreach ( $repoLinks as $wiki => $link ) { if ( !$this->siteStore->getSite( $wiki ) ) { - wfDebugLog( __CLASS__, __FUNCTION__ . ': skipping link to unknown site ' . $wiki ); - unset( $repoLinks[$wiki] ); continue; } @@ -282,9 +267,6 @@ $site = $this->siteStore->getSite( $wiki ); if ( !in_array( $site->getGroup(), $allowedGroups ) ) { - wfDebugLog( __CLASS__, __FUNCTION__ . ': skipping link to other group: ' . $wiki - . ' belongs to ' . $site->getGroup() ); - unset( $repoLinks[$wiki] ); continue; } @@ -332,8 +314,6 @@ $site = $sites->getSiteByNavigationId( $lang ); $wiki = $site->getGlobalId(); $links[$wiki] = $page; - } else { - wfWarn( "Failed to map interlanguage prefix $lang to a global site ID." ); } } } @@ -411,7 +391,6 @@ $targetSite = $this->siteStore->getSite( $siteId ); if ( !$targetSite ) { - wfLogWarning( "Unknown wiki '$siteId' used as sitelink target" ); continue; } @@ -420,8 +399,6 @@ if ( $interwikiCode ) { $link = "$interwikiCode:$page"; $out->addLanguageLink( $link ); - } else { - wfWarn( "No interlanguage prefix found for $siteId." ); } } } -- To view, visit https://gerrit.wikimedia.org/r/204255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6ec4f0482e1e7bd4a694ce7867b830d1e8de4fd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <aude.w...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits