resourceloader: Set a Title on context-created messages
authorKunal Mehta <legoktm@member.fsf.org>
Thu, 15 Sep 2016 22:11:59 +0000 (15:11 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 15 Sep 2016 22:11:59 +0000 (15:11 -0700)
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

index 30fe3ae..4a2f759 100644 (file)
@@ -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' ) );
        }
 
        /**