I've tried enabling the module on a site in development. When it didn't process the .less file, I created a test site. On the test site I installed core, less and admin_menu only. I enabled both admin_menu and less.
I created a theme called 'less_test'.
less_test.info:
name = "less"
description = "Less test theme"
core = 6.x
stylesheets[all][] = less_test.less
less_test.less:
@grey: #777;
body {
background: @grey;
}
I've cleared cache (with drush) and reloaded the page. The presulting page however has the unprocessed less file linked as a stylesheet instead of proper css output. Have a missed a step needed to get the preprocessing to work?
Comments
Comment #1
corey.aufang commentedIs your files directory writable?
Comment #2
TimeRaider commentedI have the same problem on GoDaddy's Shared-Linux account. Altho everything works perfect on XAMPP on Windows 7.
Comment #3
andb commentedYes, the files dir is writable. Testing locally on Ubuntu 10.04. Based on that question I looked into the files dir and /sites/default/files/less/sites/all/themes/less_test/less_test.css is being created and is correct. So what isn't happening is that in the final rendered page the stylesheet link with the .less extension isn't being replaced with the compiled css from the files directory.
Comment #4
andb commentedIm re-reading the module description now and think I see that this is by design. I had assumed that the less file would be compiled when changed and included as drupal css.
Is it by design that it only export a compiled file, and that I then should copy this into the theme directory? Is there a simple way to handle this during development? I can symlink the results into the theme dir, but it seems that the inclusion of the .less file in the final output could cause browser issues.
Comment #5
TimeRaider commentedI think the issue lies in less.module line #11
$base_path = $_SERVER['DOCUMENT_ROOT'] . base_path();Addition:
The way GoDaddy works is it sets the right path to addtional sites in $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] instead of $_SERVER['DOCUMENT_ROOT'], so i've changed line #11 respectively and it worked.
Comment #6
corey.aufang commentedThank you for bringing this to my attention.
I think I may have a solution that will remove the dependency on $_SERVER['DOCUMENT_ROOT'].
Try this patch:
Comment #7
andb commentedWonderful. Works as intended. Patch applied cleanly and the LESSified CSS is properly loading now. Thank you for such rapid support!
Leaving ticket open in case TimeRaider has any issues.
Comment #8
TimeRaider commentedWorked perfect for me! Thanks a lot!
PS: Please, set an appropriate status for this Issue for I'm not sure what it needs to be. It's my first time :)
Comment #9
andb commentedComment #10
corey.aufang commentedPlease don't change the status of issues to "fixed" or any of the "postponed" or "closed" statuses.
I need to use the status for tracking my work on this module, and once I complete my work for an issue, I'll change the status to "fixed".
Comment #11
corey.aufang commentedThis is now being pushed in a new version.