Hoo man has submitted this change and it was merged. Change subject: (bug 50729, bug 51699) handle exception in the langlinkhander ......................................................................
(bug 50729, bug 51699) handle exception in the langlinkhander - there are legitimate reasons for the sites table to be empty or missing the site id! - in such situations, no wikibase lang links can be found and none added, with warning Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6 --- M client/WikibaseClient.hooks.php 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: Hoo man: Verified; Looks good to me, approved diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php index 1e0577f..38d09cb 100644 --- a/client/WikibaseClient.hooks.php +++ b/client/WikibaseClient.hooks.php @@ -388,6 +388,8 @@ public static function onParserAfterParse( \Parser &$parser, &$text, \StripState $stripState ) { wfProfileIn( __METHOD__ ); + // @todo split up the multiple responsibilities here and in lang link handler + $parserOutput = $parser->getOutput(); // only run this once, for the article content and not interface stuff @@ -406,12 +408,16 @@ $useRepoLinks = $langLinkHandler->useRepoLinks( $parser->getTitle(), $parser->getOutput() ); - if ( $useRepoLinks ) { - // add links - $langLinkHandler->addLinksFromRepository( $parser->getTitle(), $parser->getOutput() ); - } + try { + if ( $useRepoLinks ) { + // add links + $langLinkHandler->addLinksFromRepository( $parser->getTitle(), $parser->getOutput() ); + } - $langLinkHandler->updateItemIdProperty( $parser->getTitle(), $parser->getOutput() ); + $langLinkHandler->updateItemIdProperty( $parser->getTitle(), $parser->getOutput() ); + } catch ( \Exception $e ) { + wfWarn( 'Failed to add repo links: ' . $e->getMessage() ); + } if ( $useRepoLinks || Settings::get( 'alwaysSort' ) ) { // sort links -- To view, visit https://gerrit.wikimedia.org/r/75371 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb5350f9bd75a522847f82f1215ff5bffcfea4d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: mw1.22-wmf11 Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Hoo man <h...@online.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits