The link to the main image that is generated by the code that handles the case where no imagecache preset is used for the main image is wrong when using i18n and using a prefix for selecting the language.
For example, if an image path is "foo.jpg", the link generated is something like "/en/sites/default/files/foo.jpg", which is clearly wrong because there is no 'en' directory on the server. It should be "/sites/default/files/foo.jpg". This is caused by the l() function when using it with a relative path. Instead of letting the URL be generated by l(), it should be fully generated by file_create_url() before handing it off to l(). Full URLs including the scheme are _not_ rewritten, so this problem will not occur.
Attached is a patch to fix this problem.
Comment | File | Size | Author |
---|---|---|---|
galleria.i18n-url-generation.patch | 713 bytes | Peter Bex |
Comments
Comment #1
Peter Bex CreditAttribution: Peter Bex commentedoops, double submit mistake. See #685650: Image link incorrect when using i18n (use file_create_url() to create links to files)