From 3be4e98a92c7fbe37f9635f2d61933f22d538ebb Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 15 Sep 2016 15:11:59 -0700 Subject: [PATCH] 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 --- includes/resourceloader/ResourceLoaderContext.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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' ) ); } /** -- 2.20.1