jenkins-bot has submitted this change and it was merged. Change subject: Don't instantiate ParserAfterParseHookHandler for interface msg parse ......................................................................
Don't instantiate ParserAfterParseHookHandler for interface msg parse Because that's quite heavy and gets called rather often on eg. special pages. Change-Id: I45a5103cd6bc8a1a9b48134be2abbe6eef43751f --- M client/includes/hooks/ParserAfterParseHookHandler.php 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Aude: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/hooks/ParserAfterParseHookHandler.php b/client/includes/hooks/ParserAfterParseHookHandler.php index 81ad94e..e297d50 100644 --- a/client/includes/hooks/ParserAfterParseHookHandler.php +++ b/client/includes/hooks/ParserAfterParseHookHandler.php @@ -81,6 +81,14 @@ return true; } + // Only run this once, for the article content and not interface stuff + + // This check needs to be here as this method is being invoked a lot, + // thus calling self::newFromGlobalState would be quite heavy + if ( $parser->getOptions()->getInterfaceMessage() ) { + return true; + } + $handler = self::newFromGlobalState(); return $handler->doParserAfterParse( $parser ); } @@ -123,13 +131,6 @@ wfProfileIn( __METHOD__ ); // @todo split up the multiple responsibilities here and in lang link handler - - // only run this once, for the article content and not interface stuff - //FIXME: this also runs for messages in EditPage::showEditTools! Ugh! - if ( $parser->getOptions()->getInterfaceMessage() ) { - wfProfileOut( __METHOD__ ); - return true; - } $parserOutput = $parser->getOutput(); $useRepoLinks = $this->langLinkHandler->useRepoLinks( $title, $parserOutput ); -- To view, visit https://gerrit.wikimedia.org/r/180063 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45a5103cd6bc8a1a9b48134be2abbe6eef43751f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: wmf/1.25wmf12c Gerrit-Owner: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Aude <aude.w...@gmail.com> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits