I was working on a MediaWiki skin for a client and decided to switch it to the 1.23rc to try out the fix for RL not handling multiple urls in a property value.
Then I discovered the whole skin's LESS completely broke when I switched to 1.23.
I've narrowed down the issue to a test case:
https://github.com/dantman/mediawiki-1.23-regresion-skin
To test:
- Clone that repo to skins/bug under a MW checkout
- Add require_once( "$IP/skins/bug/bug.php" ); to LocalSettings.php
- Use $wgShowExceptionDetails = true; so you can see the error message.
- Test with &useskin=bug
This works fine in REL1_22, however in REL1_23 and master I get the following exception when RL tries to load the skin's module:
exception 'Exception' with message 'variable @background-color is undefined: failed at background-color: @background-color !important; ./skins/bug/styles/test.less on line 5' in ./includes/libs/lessc.inc.php:3581
Stack trace:
#0 ./includes/libs/lessc.inc.php(2125): lessc_parser->throwError('variable @backg...', 60)
#1 ./includes/libs/lessc.inc.php(1880): lessc->throwError('variable @backg...')
#2 ./includes/libs/lessc.inc.php(1503): lessc->get('@background-col...')
#3 ./includes/libs/lessc.inc.php(1508): lessc->reduce(Array, false)
#4 ./includes/libs/lessc.inc.php(714): lessc->reduce(Array)
#5 ./includes/libs/lessc.inc.php(311): lessc->compileProp(Array, Object(stdClass), Object(stdClass))
#6 ./includes/libs/lessc.inc.php(249): lessc->compileProps(Object(stdClass), Object(stdClass))
#7 ./includes/libs/lessc.inc.php(223): lessc->compileCSSBlock(Object(stdClass))
#8 ./includes/libs/lessc.inc.php(719): lessc->compileBlock(Object(stdClass))
#9 ./includes/libs/lessc.inc.php(311): lessc->compileProp(Array, Object(stdClass), Object(stdClass))
#10 ./includes/libs/lessc.inc.php(305): lessc->compileProps(Object(stdClass), Object(stdClass))
#11 ./includes/libs/lessc.inc.php(220): lessc->compileRoot(Object(stdClass))
#12 ./includes/libs/lessc.inc.php(1927): lessc->compileBlock(Object(stdClass))
#13 ./includes/libs/lessc.inc.php(1950): lessc->compile('@import "mediaw...', '...')
#14 ./includes/libs/lessc.inc.php(2022): lessc->compileFile('...')
#15 ./includes/resourceloader/ResourceLoaderFileModule.php(809): lessc->cachedCompile(Array)
#16 ./includes/resourceloader/ResourceLoaderFileModule.php(719): ResourceLoaderFileModule->compileLESSFile('...')
#17 ./includes/resourceloader/ResourceLoaderFileModule.php(692): ResourceLoaderFileModule->readStyleFile('bug/styles/test...', false)
#18 ./includes/resourceloader/ResourceLoaderFileModule.php(321): ResourceLoaderFileModule->readStyleFiles(Array, false)
#19 ./includes/resourceloader/ResourceLoader.php(812): ResourceLoaderFileModule->getStyles(Object(ResourceLoaderContext))
#20 ./includes/resourceloader/ResourceLoader.php(546): ResourceLoader->makeModuleResponse(Object(ResourceLoaderContext), Array, Array)
#21 ./load.php(43): ResourceLoader->respond(Object(ResourceLoaderContext))
#22 ./maintenance/dev/includes/router.php(61): require('...')
#23 {main}
From the looks of it the @import "./variables"; stopped loading the styles/variables.less file in 1.23.
Note that it may be possible that this bug is only triggered when:
- A directory like styles/ is used instead of putting the .less files in the root.
- The file you're trying to import is named variables.less.
Version: 1.23rc
Severity: major