From: Kunal Mehta Date: Thu, 15 Sep 2016 22:11:59 +0000 (-0700) Subject: resourceloader: Set a Title on context-created messages X-Git-Tag: 1.31.0-rc.0~5537^2 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=3be4e98a92c7fbe37f9635f2d61933f22d538ebb;p=lhc%2Fweb%2Fwiklou.git resourceloader: Set a Title on context-created messages Ensure that messages created using ResourceLoaderContext::msg() have a title set so they don't trigger the GlobalTitleFail log. We use a dummy title since there is no real title we can use here, and the cache doesn't vary on a title anyways. This particular title was picked especially for Roan. This patch should quiet the GlobalTitleFail logs for MFResourceLoaderParsedMessageModule and VisualEditorDataModule. Change-Id: I502faa22776e1cb34a6ef17be96567f121c80081 --- diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index 30fe3ae4ac..4a2f759d5e 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -219,7 +219,11 @@ class ResourceLoaderContext { */ public function msg() { return call_user_func_array( 'wfMessage', func_get_args() ) - ->inLanguage( $this->getLanguage() ); + ->inLanguage( $this->getLanguage() ) + // Use a dummy title because there is no real title + // for this endpoint, and the cache won't vary on it + // anyways. + ->title( Title::newFromText( 'Dwimmerlaik' ) ); } /**