Hallo
In a multilanguage site where the node path is http://www.mystite.org/en the image path
src="/sites/default/files/myimage.jpg"
is converted to
src=" http://www.mystite.org/ensites/default/files/myimage.jpg"
istead of
src=" http://www.mystite.org/en/sites/default/files/myimage.jpg".
No image is visible
Comments
Comment #1
Xigi commentedStill an issue for 6.x-1.0
Comment #2
mahnster commentedAlso have this problem. Subscribbing
Comment #3
mahnster commentedAnd to add on to that, I realized putting a / between "en" (or whatever language) and sites, e.g. /en/sites/all/files/logo.png, does not work because that is not the actual directory...it needs to NOT add the language "directory" onto the URL, it should be just http://www.example.com/sites/all/files/logl.png. Maybe this is the problem with the url() function that this module calls?
Comment #4
ehudash commentedI had the same problem in my multi-lingual and multi-domain site.
I fixed it by doing 2 things:
1. for links, keep the original preg_replace call by changing the pattern to look only for href, not src.
2. copy the original preg_replace and paste it under the original (add a nother preg_replace). set it to look only for images (src instead of href) and used the global $_domain variable to set the correct domain base url: $_domain['scheme'].'://'.$_domain['sitename'].'/'
This is the solution I found for multi-domain sites. not sure if it will work on single domain sites as well.
Comment #5
sbozhko commented+1. Subscribed
Comment #6
AlanAtLarge commentedSubsicibe too.
Comment #7
planctus commentedWell, i had the same problem..
i fixed like this:
The url() function supports languages so we can pass the default one that should not carry any prefix.
I simply needed this for image urls, so i didn't care much about the links.
Obviously this way you're forcing drupal to use the default language even for those ones.
See you,
Da.
Comment #8
lourenzo commentedFixed and released in 6.x-1.1
Comment #9
houndbee commentedLooks like this change hasn't made it into the 7.x version?