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.

CommentFileSizeAuthor
galleria.i18n-url-generation.patch713 bytesPeter Bex
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Peter Bex’s picture

Status: Needs review » Closed (duplicate)