Hi,

I've spent several hours on a "clean" multilanguage setup with subdomains per language (en.mysite.tld, fr.mysite.tld...) with a shared database and a shared files folder ("clean" setup = without symlinks or rewrites in .htaccess). The setup is working fine, including content transalation and the language switcher, except that images don't work anymore (no images are displayed in the browser).

When inspecting the code, I get markup for images like this: <img src="//sites/default/files/images/image.png" alt="Image" title="Image" class="image image-preview " width="640" height="396"/>. The location of the img src is correct, and Dragonfly/Firebug do load the correct image file - but only when the image is inspected, not in the normal browser display.

When comparing the markup with an one-language site with working images, the markup looks very similar, e.g.: <img src="/sites/default/files/images/Anotherimage.jpg" alt="Another image" title="Another image" class="image image-preview " width="640" height="190"/>. So the only difference is the double slash (//) instead of a single slash (/). And indeed, if I replace the double slash in Dragonfly, the image immediately loads into the browser. The nasty question is where this double slash comes from and how I can get rid of it.

Relevant paths:

  • ./admin/settings/image/nodes: "images"
  • ./admin/settings/file-system/settings: "sites/default/files"

I tried to set a multilingual variable for the files folder in ./sites/default/settings.php (approach a), and/or in ./sites/en.mysite.tld/settings.php, ./sites/fr.mysite.tld/settings.php, etc. (approach b) like this:

/**
 * Multilingual settings
 */
 $conf['i18n_variables'] = array(
 'file_directory_path',
);

But it doesn't seem that this variable even exists.

In older versions of the 'Image' module, there were a number of file-path related issues (e.g. #130473: Problem with image file paths? Thought this would be related to corrupted images when editing ...); those issues have been fixed for single-site installations, but there is not much feedback for multisite or multilingual setups. So this is either a rather exotic bug with legacy code, or (more probable) a configuration issue.

Thus I'm opening a support/documentation request, asking for recommendations for a multilanguage installation with shared files folder across multiple language subdomains.

Thanks for any suggestions or best practise advise!
-asb

Comments

asb’s picture

I forgot the language settings from ./admin/settings/language:

I'm using this together with "Language negotiation: Domain name only" at ./admin/settings/language/configure.

As soon as I disable all additional languages and language domains at ./admin/settings/language, images reappear; the img src paths then start with a single slash. Alternatively, I can enable additional languages, but switch "Language negotiation" at ./admin/settings/language/configure to "None" (which obviously has the side effect that any node in any language becomes available under any language sub-domain, so this is a great way to receive a major beating for massive duplicate content, and to totally bork modules like 'boost').

So an easy procedure to break images seems to be to use "Language negotiation: Domain name only" together with multiple language sub-domains.

Bug or misconfiguration???