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.
I just found that the path returned by url() prepends the language path prefix (this is the way I have my site set up) to the image path, which causes the sprite to not show up.
I fixed it this way (sprites.inc):
// Wrong:
' background:url("'.url($options['sprite_path']).'.png'.$options['rand_str'].'") 0px -'.$y.'px no-repeat;'."\n".
// Fixed:
' background:url("/'.$options['sprite_path'].'.png'.$options['rand_str'].'") 0px -'.$y.'px no-repeat;'."\n".
I did the change in the three places where the mixin is generated (smart, horz and vert).
Comment | File | Size | Author |
---|---|---|---|
#3 | sasson-sprites-multilingual-1748332-3.patch | 1.75 KB | jedihe |
#1 | sasson-sprites-multilingual-1748332.patch | 1.71 KB | jedihe |
Comments
Comment #1
jedihe CreditAttribution: jedihe commentedCreated a patch with my changes from 7.x-2.5.
Comment #2
tsi CreditAttribution: tsi commentedThanks for the patch !
This is already fixed in the 3.x branch but should be backported to the 2.x branch.
You should use
base_path()
instead of just assuming it's '/'Comment #3
jedihe CreditAttribution: jedihe commentedRe-rolled the patch prepending base_path() instead of applying url().
Comment #4
tsi CreditAttribution: tsi commentedhttp://drupal.org/commitlog/commit/31168/00069ddd7b2a7e36c4e5bbabd92722c...
Thanks!