Last modified: 2014-02-20 02:56:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61858, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59858 - Difficult to debug LESS compilation errors
Difficult to debug LESS compilation errors
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-09 05:31 UTC by Santhosh Thottingal
Modified: 2014-02-20 02:56 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Santhosh Thottingal 2014-01-09 05:31:09 UTC
If there is a compilation error with the less files, the only exception we get is 

Warning: array_map(): An error occurred while invoking the map callback in /home/santhosh/dev/wiki/core/includes/resourceloader/ResourceLoaderFileModule.php

This is not helpful. Because array maps cannot properly report errors from callbacks.

Roan already reported this issue at PHP with a patch. https://bugs.php.net/bug.php?id=55416 but not accepted at upstream.

Can't we modify the code in readStyleFiles of ResourceLoaderFileModule a bit so that we get sensible stack trace and saves time in debugging?

instead of array map, it can be something like

$style= "";
foreach ( $files as $file  ) {
  $style = $style . "\n".  $this->readStyleFile( $file,  $flip );
}
$styles[$media] = $style;

What I expect is a helpful error message like:

exception 'Exception' with message '.mw-ui-one-third is undefined: failed at `.mw-ui-one-third;` /home/santhosh/dev/wiki/ContentTranslation/modules/base/styles/base.less on line 27' in /home/santhosh/dev/wiki/core/includes/libs/lessc.inc.php:3527
Comment 1 Gerrit Notification Bot 2014-02-13 06:27:20 UTC
Change 109956 had a related patch set uploaded by Santhosh:
Unroll array_map in ResourceLoaderFileModule::readStyleFiles

https://gerrit.wikimedia.org/r/109956
Comment 2 Gerrit Notification Bot 2014-02-13 06:28:09 UTC
Change 106486 abandoned by Santhosh:
Avoid array_map to get useful debug information about LESS errors

Reason:
Abandoning in favor of I7c48b2c94752eee81f0eeb8e00d1f2b526d80dfc

Same approach is used in that patch

https://gerrit.wikimedia.org/r/106486
Comment 3 Gerrit Notification Bot 2014-02-19 19:20:52 UTC
Change 109956 merged by jenkins-bot:
Unroll array_map in ResourceLoaderFileModule::readStyleFiles

https://gerrit.wikimedia.org/r/109956
Comment 4 Umherirrender 2014-02-19 19:37:13 UTC
successfully merged
Comment 5 Santhosh Thottingal 2014-02-20 02:56:41 UTC
Thanks Umherirrender.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links