I have a multilingual site. The default language is English.
When I open an image node and click on an image_size link, the image is not found:

The URL is: http://localhost/drupal/en/sites/default/files/images/cryos_head_0.thumb...
But it should be: http://localhost/drupal/sites/default/files/images/cryos_head_0.thumbnai...

The language prefix "en" must be removed.
I have attached a screenshot to indicate which links I mean.

CommentFileSizeAuthor
image_link.JPG111.02 KBtomsm

Comments

georg66’s picture

Same Problem on my site.
Example: http://www.landhotel-repetal.de/de/node/211

joachim’s picture

(I could have sworn we already had an issue open for this, but can't find it.)

Seems l() has an undocumented 'language' option. (#720226: documentation for l() missing language key).

So presumably, we can pass something for this into hook_links... only I'm not sure *what* we need to pass in!

I will look at this at some point, but if anyone feels like helping, please do -- especially someone who knows how language works in Drupal and has a multilingual test site to work on.

joachim’s picture

I don't know what I need to pass to l() in the language option to make it make a language-neutral link.

joachim’s picture

That link should actually be of the form:

/fr/node/143?size=thumbnail

Are you using lightbox or somesuch? Lightbox2 alters that link that image module creates. If that is what is happening to you too, then please refile this bug.

For the record, passing in 'language' => '' seems to do the trick, but I don't think it's something fixable from image module.

georg66’s picture

When you click on my link in #1, you see that I'm using lightbox2

joachim’s picture

Please move this to lightbox then! :)

georg66’s picture

Do you think, it's a bug in lightbox2? In node-view http://www.landhotel-repetal.de/de/node/211 the links to 'Miniaturansicht' and 'Preview' are created with language prefix.
When I copy these links http://www.landhotel-repetal.de/de/sites/default/files/images/winter13.t... directly in my browser without using lightbox, I will get 'Page not found' because of the language prefix /de/

joachim’s picture

Turn off lightbox and see if you still get the bug. The node links should not be direct to the file, but to /fr/node/143?size=thumbnail

Though there probably is a bug if you set to open in a new window -- I will check that. In which case, please file a fresh issue rather than move this one.

joachim’s picture

Status: Active » Closed (works as designed)

All seems to work for me.

Please feel free to reopen if you can provide more information -- though note that this is perhaps a bug with Lightbox.