Hi all,

I have a problem with my images path.

I have 2 languages fr and en, but one directory files/images/ for both languages images.

When a created a page and added the image path files/images/myimages.jpg, the image can't appear on drupal, because of the internationalization the path became en/files/images/myimages.jpg or fr/files/images/myimages.jpg

I don't want to create 2 directories for my images, so is there a way to don't have such problem ? Is it a bug ?

I am a real newbie and searched all the day for a solution without success.

It's maybe very easy.

Thanks in advance.

Comments

rszrama’s picture

A similar problem was reported by an Ubercart user in that our PayPal module creates a URL for PayPal's to return customers to. This URL is then getting altered by i18n so it fails. Should be /uc_paypal/wps/complete but it gets changed to /en/uc_paypal/wps/complete. I'm assuming the solution would be similar, so I'll direct traffic from that thread to this issue for a response.

Augustin’s picture

Thanks for the help Rszrama,

I hope the Ubercart community will be more active on this bug.

I am beginning crazy with this, I tried to found solutions (like making alias on my ftp folder or using path redirect module) but without success.
It appears that we are several to have the same issue (http://drupal.org/node/208474 , http://drupal.org/node/222132, http://drupal.org/node/185877).

If there are some hard core code killers in the place, please show yourself ! ;)

mediamash’s picture

Augustin, got a solution yet for this issue? When i log out from the website the images are not showing, when i log in they are back in bussiness ...

EDIT: solution found for my problem: edit imagecache permissions in admin/user/access to each user in order to view the several imagecache categories

jose reyero’s picture

Category: bug » support

Some modules are using url functions (l, url) instead of path functions (file_create_path...) for file URLs, these are the ones that should be fixed IMHO.

rszrama’s picture

fwiw, the problem related to Ubercart was for a module defined callback that PayPal expects to be able to send payment notifications to... I'm not sure how that would apply to comment #4.

keesje’s picture

Version: 5.x-2.2 » 5.x-2.5

This still applies. Im not sure who's bug this is. It is a serious showstopper though.
Cant use imagecache 2.# for example without the path being altered to /lng/files/etc

Please look here: http://drupal.org/node/259060
I tend to agree that i18n should be more carefull rewriting URL's.

neurovation.kiwi’s picture

Status: Active » Needs review

well - i have the same problem with imagecache.

why don't you just turn this

if (!function_exists('custom_url_rewrite')) {
  function custom_url_rewrite($type, $path, $original) {
    return i18n_url_rewrite($type, $path, $original);
  }
}

into that

if (!function_exists('custom_url_rewrite')) {
  function custom_url_rewrite($type, $path, $original) {
    if (strpos($path,file_directory_path()) !== FALSE) {
      return $path;
    }
    return i18n_url_rewrite($type, $path, $original);
  }
}

i know one could argue that maybe others are to work this out - but honestly - is there any sense at all to add the language in front of the file path?

i patched it anyways - and i suppose most others will do, too!

thanks!
kiwi

jose reyero’s picture

Status: Needs review » Closed (won't fix)

There are some modules using URL APIs instead of file path functions, Note the core file upload works.

For 5.x only critical bug fixes. Consider upgrading to 6.x