Not entirely sure what exactly is the issue, here, but in my installation, I encounter the following problem.
Every one of my content pages has an English and a Dutch version, and I'm using pathauto.
Let's say the English version of my 'Home'-page's clean url is "/home", while the actual url is "/node/23".
The Dutch version sits at "/nl/home", its actual url being "/node/22".
Logically, the redirect would happen to "/nl/home", but instead, "/nl/node/23" is returned, a url that probably shouldn't actually exist, but displays the English content instead of the Dutch content.
Am I just doing this wrong?
Comments
Comment #1
Gabriel R. commentedI had this before using ip2locale. I sure hope there is a clean solution.
Comment #2
paulhudson commentedHi,
Among other things:
I think drupal_get_path_alias() required the path of the translation node not the current node - therefore we get the correct alias as they are probably different???
Also, $prefix seems to normally have a value so I needed to add an elseif to the switch... not sure I understand the logic here...
Here's the modified function:
Please play around with this... I'm not using it on a production site so not fully testing it. Let me know if there's something stupid with the code and I'll try to sort it.
Paul
Comment #3
m.sant commentedI tried the proposed changes but it didn't work.
With the last development version I get the following error messages:
Notice: Undefined index: q in .../sites/all/modules/ip2locale/ip2locale.module on line 211
Notice: Undefined variable: redirect in .../sites/all/modules/ip2locale/ip2locale.module on line 251
I have the same behaviour also if I disable the clean urls.
Regards,
Marco
Comment #4
mrfelton commentedPlease try with the latest code in git.