Sasson's URL helpers seem to be specifically adjusted for use cases like image-url(). Problem arises when trying to use inline-image() function (generates a base64 inline data URI).
Error is caused by using base_path() to construct the $images_path parameter; according to this comment on base_path()'s docs that function is for URLs, but inline-image() is an operation that happens to require physical access to the file, thus requiring a local-filesystem path (server's filesystem).
// Line 195 in sass.inc from 2.x-dev
$images_path = theme_get_setting('sasson_images_path') ? theme_get_setting('sasson_images_path') : base_path() . drupal_get_path('theme', $theme_name) . '/images';
$fonts_path = theme_get_setting('sasson_fonts_path') ? theme_get_setting('sasson_fonts_path') : base_path() . drupal_get_path('theme', $theme_name) . '/fonts';
// Side note: I guess '/styles' is what should be at the end of the line...
$stylesheets_path = theme_get_setting('sasson_stylesheets_path') ? theme_get_setting('sasson_stylesheets_path') : base_path() . drupal_get_path('theme', $theme_name) . '/styls';
Tried this fix:
$images_path = theme_get_setting('sasson_images_path') ? theme_get_setting('sasson_images_path') : DRUPAL_ROOT . '/' . drupal_get_path('theme', $theme_name) . '/images';
// fonts and stylesheets don't care, they are requested by the browser, so URLs logic is the right for them
Which gives correct operation for inline-image(), but breaks image-url() (urls now have full server-path of the file).
Comments
Comment #1
tsi CreditAttribution: tsi commentedNever used inline-image(), so just throwing guesses here -
I'm not sure the bug is in the wrong path, seems to me like it might be in the php compiler.
Compass docs clearly mention -
Assuming you are using Sasson v2.x with the php compiler, would it be possible to try doing the same operation with Sasson v3.x using the ruby compass compiler ?
Thanks for catching the typo BTW, fixed :)
Comment #2
tsi CreditAttribution: tsi commentedThe PHP compiler used in Sasson 2.x is no longer needed in v3.x and I don't see me or anyone else getting to maintain it.
Marking all relevant issues as won't fix. sorry.
You are welcome to try the much more powerful v3.x