Download & Extend

language prefix causes wrong path to image directory

Project:Image
Version:6.x-1.x-dev
Component:image.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
image_link.JPG111.02 KBIgnored: Check issue status.NoneNone

Comments

#1

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

#2

(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.

#3

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

#4

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.

#5

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

#6

Please move this to lightbox then! :)

#7

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/

#8

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.

#9

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.

nobody click here