Recently I upgraded one development site to kernel 7.12. This site uses i18n with two languages.

One content type has attached an image field with no limit in the number of images. My original setup for display the field was a field slideshow linked to colorbox to show the images in its original size.

Everything was working flawlessly until I upgraded the kernel.

Now, the slideshow works fine but the urls it generates for colorbox are wrong. It adds the language prefix twice resulting in links like this:
http://localhost/imfes02/?q=es/es/system/files/styles/medium/private/pro...

If I change the display configuration linking the original image not using colorbox the results are the same, the url generated is wrong.

Instead, if I use the native way of display the images, i.e. not using a field slideshow, everything works fine.

The changelog for kernel 7.12 has a warning about multilingual sites but it doesn't explain the issues.

In my site, this one is the only issue I've found with the new kernel.

CommentFileSizeAuthor
#3 bad_url_language-1431146-3.patch727 bytesidflood

Comments

mariogalan’s picture

Title: Bad urls generated (maybe related to i18n and kernel 7.12) » Bad urls generated (maybe related to i18n and core 7.12)

Well, obviously, when I say kernel I meant core. My fault. :-)

fietserwin’s picture

This issue might be related to core issue #1196606: url()/locale_language_url_rewrite_url(): language prefix should not be added to URL's pointing to existing resources. That issue is still about finding out if we think that the url() function should be able to handle paths to existing resources, or that only file_create_url() should be used for that.

Workaround: use file_Create_url(), or, if you want to use url(): pass in a language object that has an empty prefix property:

global $language;
$url_options['language'] = clone $language;
$url_options['language']->prefix = '';
$url = url($path, $url_options)
idflood’s picture

Status: Needs review » Active
StatusFileSize
new727 bytes

@mariogalan: I tried to reproduce you issue but the url was good. Did I missed something?
- installed i18n/variables and actived nearly all i18n modules (not the forum translation and some others)
- added a french language, enabled path detection and added the language switcher block
- defined my image field to display the field_slideshow with the "link image to" colorbox setting
- accessed to my node with the french and english language, the paths were ok (they had no language prefix at all)
ex: http://localhost/d7_field_slideshow/sites/default/files/styles/large/pub...

You can try the following patch but I would like to replicate the issue before pushing the fix.

edit: The patch is probably not subtle enough. It should certainly only do this for image and colorbox links but not for nodes.

idflood’s picture

Status: Active » Needs review
idflood’s picture

Status: Active » Postponed (maintainer needs more info)

@mariogalan: can you define a step by step way to reproduce the issue? I've tried again by downloading drupal 7.12 and field_slideshow 1.6, and tried the steps described in #3 but still no luck.

lamp5’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)