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).

Comments

jedihe’s picture

Title: Wrong path to sprite image on multi-lingual setup (path-prefix mode) » Wrong path to sprite image on multi-lingual setup (path-prefix mode) [patch]
StatusFileSize
new1.71 KB

Created a patch with my changes from 7.x-2.5.

tsi’s picture

Status: Active » Needs work

Thanks 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 '/'

jedihe’s picture

Status: Needs work » Needs review
StatusFileSize
new1.75 KB

Re-rolled the patch prepending base_path() instead of applying url().

tsi’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.