Page MenuHomePhabricator

Wikibase\Repo\Hooks\LinkBeginHookHandler unstubs $wgLang unnecessarily during LinkBegin hook
Closed, ResolvedPublic

Description

/srv/mediawiki/php-1.27.0-wmf.18/includes/session/SessionManager.php:186
/srv/mediawiki/php-1.27.0-wmf.18/includes/WebRequest.php:683
/srv/mediawiki/php-1.27.0-wmf.18/includes/user/User.php:1208
/srv/mediawiki/php-1.27.0-wmf.18/includes/user/User.php:402
/srv/mediawiki/php-1.27.0-wmf.18/includes/user/User.php:5122
/srv/mediawiki/php-1.27.0-wmf.18/includes/user/User.php:2744
/srv/mediawiki/php-1.27.0-wmf.18/includes/context/RequestContext.php:368
/srv/mediawiki/php-1.27.0-wmf.18/extensions/Wikidata/extensions/Wikibase/lib/includes/LanguageFallbackChainFactory.php:193
/srv/mediawiki/php-1.27.0-wmf.18/extensions/Wikidata/extensions/Wikibase/repo/includes/Hooks/LinkBeginHookHandler.php:69
/srv/mediawiki/php-1.27.0-wmf.18/extensions/Wikidata/extensions/Wikibase/repo/includes/Hooks/LinkBeginHookHandler.php:97
/srv/mediawiki/php-1.27.0-wmf.18/includes/Hooks.php:195
/srv/mediawiki/php-1.27.0-wmf.18/includes/Linker.php:213
/srv/mediawiki/php-1.27.0-wmf.18/includes/parser/LinkHolderArray.php:420
/srv/mediawiki/php-1.27.0-wmf.18/includes/parser/LinkHolderArray.php:271
/srv/mediawiki/php-1.27.0-wmf.18/includes/parser/Parser.php:5291
/srv/mediawiki/php-1.27.0-wmf.18/includes/parser/Parser.php:1315
/srv/mediawiki/php-1.27.0-wmf.18/includes/parser/Parser.php:449
/srv/mediawiki/php-1.27.0-wmf.18/includes/cache/MessageCache.php:1090
/srv/mediawiki/php-1.27.0-wmf.18/includes/Message.php:1109
/srv/mediawiki/php-1.27.0-wmf.18/includes/Message.php:791
/srv/mediawiki/php-1.27.0-wmf.18/includes/Message.php:847
/srv/mediawiki/php-1.27.0-wmf.18/extensions/MobileFrontend/includes/modules/MFResourceLoaderParsedMessageModule.php:47
/srv/mediawiki/php-1.27.0-wmf.18/extensions/MobileFrontend/includes/modules/MFResourceLoaderParsedMessageModule.php:78
/srv/mediawiki/php-1.27.0-wmf.18/includes/resourceloader/ResourceLoaderModule.php:588
/srv/mediawiki/php-1.27.0-wmf.18/includes/resourceloader/ResourceLoaderModule.php:556
/srv/mediawiki/php-1.27.0-wmf.18/includes/resourceloader/ResourceLoader.php:973
/srv/mediawiki/php-1.27.0-wmf.18/includes/resourceloader/ResourceLoader.php:702
/srv/mediawiki/php-1.27.0-wmf.18/load.php:47
/srv/mediawiki/w/load.php:3

More specifically, this occurs when a ResourceLoader module parses a message on wikidata.org that contains a link. I note that the hook handler doesn't actually do anything in the load.php code path since there will be no Title set so shouldConvert() will return false.

Event Timeline

Change 282064 had a related patch set uploaded (by Legoktm):
Short-circuit LinkBegin hook if no title is set in the main context

https://gerrit.wikimedia.org/r/282064

Change 282064 merged by jenkins-bot:
Short-circuit LinkBegin hook if no title is set in the main context

https://gerrit.wikimedia.org/r/282064

When can we expect this fix to be deployed to WMF wikis?

It was synced from Wikibase to Wikidata in 264ab0627068 on 2016-04-07. Should be in prod this week.