Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The new compass binary support should be fixed using the correct binary path.
If compass is not available on a system path, the command will not be executed.
exec("compass version", $out, $rvalue);
A simple solution would be to add the compass path on sasson settings in order to allow custom settings.
Many thanks :-)
Comments
Comment #1
tsi CreditAttribution: tsi commentedInteresting.
If we expose a "path to compass" field how should that be used in our code ?
How many people would actually use that ?
Any links for further reading ?
Thank you
Comment #2
FiNeX CreditAttribution: FiNeX commentedWell, if "path to compass" has been set it should be used in place of the default value:
On my specific case I'm using Debian 6 and compass is not available on default repository. You've to install using gem. If your're using bash you've to manually set the gem path like:
But the owner of php/httpd process doesn't know that path.
We have two solutions:
About your question "how many people would actually use that"... well... probably few because compass (and sasson) are not so common, but those few could be use Debian or even CentOS (another common web server which doesn't ship compass packages) and I believe that configuring compass PATH to php/httpd system user is worse than setting it to the sasson settings.
What do you think about?
Thanks for your attention :-)
Comment #3
tsi CreditAttribution: tsi commentedI don't actually understand the problem. I'm not a linux guru but I do use it (ubuntu) daily on all of my machines, I, too installed the gem and compiling without issues.
Anyway, I think our best solution will be to set the path via code, without cluttering the UI, any thoughts on how this should be done ?
I think something like:
variable_set('path_to_compass', 'path/to/compass');
Should be "themer friendly" enough, no?
We should also consider security issues since this is going straight to the exec() function.
Comment #4
FiNeX CreditAttribution: FiNeX commentedWell, it should be good solution. If compass is available on the known paths everything works fine, otherwise the theme developer can change the value from a "settings" file. Not bad, it only needs to be clearly documented.
2 cents about security: setting the path from the configuration file is just a bi more secure than setting the variable from the UI because I suppose that the user who can set that variable from the UI probably have enough privileges to damage the entire website :-) :-) :-)
Anyway every solution is fine, the most important thing is to document it.
Thanks again Tsachi :-)
Comment #5
tsi CreditAttribution: tsi commentedPushed a fix.
You can now use:
variable_set('sasson_compass_path', 'path/to/compass');
To set a path to the compass binary.
I guess you can put it anywhere in your sub-theme's template.php
Please help testing this.
Comment #6
mxmilkiib CreditAttribution: mxmilkiib commentedThat worked for me, thanks!
I'd set the correct $PATH for the httpd user, which could run compass anywhere in bash and sh, and had restarted nginx, but dpm($rvalue) said 126 (unexecutable). I updated Sasson, added subtheme template.php
variable_set('sasson_compass_path', '/var/lib/gems/1.8/bin/compass');
, and things started working.Comment #7
tsi CreditAttribution: tsi commentedGreat, Thanks!