ResourceLoaderOOUIImageModule: Actually load non-default themes' images
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 17 Mar 2017 01:21:34 +0000 (02:21 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Fri, 17 Mar 2017 02:30:22 +0000 (03:30 +0100)
Values in SkinOOUIThemes are TitleCase, but these filenames are
lowercase. And we silently ignore missing files. This only worked for
the default theme, which is hardcoded to lowercase 'mediawiki' above.

Change-Id: I5b14d65a8f7d5219acfa2a40eabbb13617833b26

includes/resourceloader/ResourceLoaderOOUIImageModule.php

index 29f5cce..14e5c26 100644 (file)
@@ -41,7 +41,7 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule {
                foreach ( $themes as $skin => $theme ) {
                        // Find the path to the JSON file which contains the actual image definitions for this theme
                        // TODO Allow extensions to specify this path somehow
-                       $dataPath = $rootPath . '/' . $theme . '/' . $name . '.json';
+                       $dataPath = $rootPath . '/' . strtolower( $theme ) . '/' . $name . '.json';
                        $localDataPath = $this->localBasePath . '/' . $dataPath;
 
                        // If there's no file for this module of this theme, that's okay, it will just use the defaults