From: Tim Starling Date: Mon, 3 Apr 2017 03:55:48 +0000 (+1000) Subject: Fix two bugs in installer session error display X-Git-Tag: 1.31.0-rc.0~3624^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=13c311bb0c12cff86f3b2cc6ffc47ff9571d31ee;p=lhc%2Fweb%2Fwiklou.git Fix two bugs in installer session error display If Installer::startSession() returns false, then showError() is called before setParserLanguage(), which causes DB access via Title::getContentModel(). The code which was meant to handle DB access from the parser did not do so, since the exception class which is thrown on attempted DB access has changed. Change-Id: I1478ec06a441851c5336bdde15734642615d45e9 --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index f03fe6a3f4..0a2b8084e2 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -446,6 +446,8 @@ abstract class Installer { $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :( $this->parserOptions->setEditSection( false ); + // Don't try to access DB before user language is initialised + $this->setParserLanguage( Language::factory( 'en' ) ); } /** @@ -674,7 +676,7 @@ abstract class Installer { try { $out = $wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart ); $html = $out->getText(); - } catch ( DBAccessError $e ) { + } catch ( MediaWiki\Services\ServiceDisabledException $e ) { $html = ' ' . htmlspecialchars( $text ); if ( !empty( $this->debug ) ) {