Set the context language early, even before the session is loaded, to
avoid attempting to call User::loadFromSession(). Also update the things
that set $wgLang to also set it in RequestContext.
Passing $wgUser through to the ParserOptions constructor isn't strictly
necessary right now, but it does at least show the intended data flow
and is more robust to future changes in the way the language is passed
through to ParserOptions.
Fixes bug T126177 independently of my other two patches.
Bug: T126177
Change-Id: I15eb9cdce7805382d96b6fc6ffb9b25855876417
$wgContLang = Language::factory( $option['lang'] );
$wgLang = Language::factory( $option['lang'] );
$wgLanguageCode = $option['lang'];
$wgContLang = Language::factory( $option['lang'] );
$wgLang = Language::factory( $option['lang'] );
$wgLanguageCode = $option['lang'];
+ RequestContext::getMain()->setLanguage( $wgLang );
}
$this->setVar( 'wgSitename', $siteName );
}
$this->setVar( 'wgSitename', $siteName );
public function __construct() {
global $wgMessagesDirs, $wgUser;
public function __construct() {
global $wgMessagesDirs, $wgUser;
+ // Don't attempt to load user language options (T126177)
+ // This will be overridden in the web installer with the user-specified language
+ RequestContext::getMain()->setLanguage( 'en' );
+
// Disable the i18n cache
Language::getLocalisationCache()->disableBackend();
// Disable LoadBalancer and wfGetDB etc.
// Disable the i18n cache
Language::getLocalisationCache()->disableBackend();
// Disable LoadBalancer and wfGetDB etc.
}
$this->parserTitle = Title::newFromText( 'Installer' );
}
$this->parserTitle = Title::newFromText( 'Installer' );
- $this->parserOptions = new ParserOptions; // language will be wrong :(
+ $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
$this->parserOptions->setEditSection( false );
}
$this->parserOptions->setEditSection( false );
}
$langCode = 'en';
}
$wgLang = Language::factory( $langCode );
$langCode = 'en';
}
$wgLang = Language::factory( $langCode );
+ RequestContext::getMain()->setLanguage( $wgLang );
$installer->setParserLanguage( $wgLang );
$installer->setParserLanguage( $wgLang );