jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/400390 )

Change subject: Do not fail when we can't get the config
......................................................................


Do not fail when we can't get the config

Config is not available when running in the context of the MediaWiki
installer.

Bug: T183640
Change-Id: Iaf3fa508fb71e93570120134f7c44001f5833f1c
---
M ResourceLoaderLessModule.php
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ResourceLoaderLessModule.php b/ResourceLoaderLessModule.php
index 38eb06a..5849755 100644
--- a/ResourceLoaderLessModule.php
+++ b/ResourceLoaderLessModule.php
@@ -24,11 +24,16 @@
 
 use CSSMin;
 use MediaWiki\MediaWikiServices;
+use ConfigException;
 use ResourceLoaderContext;
 use ResourceLoaderFileModule;
 
 /**
  * ResourceLoader module for print styles.
+ *
+ * This class is also used when rendering styles for the MediaWiki installer.
+ * Do not rely on any of the normal global state, services, etc., and make sure
+ * to test the installer after making any changes here.
  */
 class ResourceLoaderLessModule extends ResourceLoaderFileModule {
        /**
@@ -39,8 +44,13 @@
         */
        protected function getLessVars( ResourceLoaderContext $context ) {
                $lessVars = parent::getLessVars( $context );
-               $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'vector' );
-               $printLogo = $config->get( 'VectorPrintLogo' );
+               try {
+                       $config = 
MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'vector' );
+                       $printLogo = $config->get( 'VectorPrintLogo' );
+               } catch ( ConfigException $e ) {
+                       // Config is not available when running in the context 
of the MediaWiki installer. (T183640)
+                       $printLogo = false;
+               }
                if ( $printLogo ) {
                        $lessVars[ 'printLogo' ] = true;
                        $lessVars[ 'printLogoUrl' ] = CSSMin::buildUrlValue( 
$printLogo['url'] );

-- 
To view, visit https://gerrit.wikimedia.org/r/400390
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf3fa508fb71e93570120134f7c44001f5833f1c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/Vector
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to