Closed (works as designed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2008 at 16:11 UTC
Updated:
13 Oct 2008 at 20:52 UTC
We tried to get the aliased URL with url('node/'. $source_node->nid, array('language' => $source_node->language)), but we only get the internal URL with base_path.
I verified that the URL for node/11 have an alias named "impressum" and the node is shown on the site with "de/impressum". If I switch to the English version of the node/64 I get "en/imprint". Therefore from DB side it looks all correct only the url() behaves wrong and does not return the correct URL. I expected to get on the English node when I call URL with DE language the alias to the German node!?
This seems to be a bug to me. Could someone please help?
Comments
Comment #1
catchI doubt this code has changed in Drupal 7, so moving it there for additional eyes.
Comment #2
damien tournoud commentedLet's say you have two nodes:
- node/11 is a German node, with a path alias pointing to "de/impressum"
- node/64 is an English node (translation of node/11), with a path alias pointing to "en/imprint"
In that case, if
$languages = language_list(), here is what you should see:This is because path aliases are *per language*, and that aliases generated by nodes are in the language of their node by default.
Are you seeing anything different?
Comment #3
damien tournoud commentedOh, and you should use:
instead of:
Because url() expects a language object, not a language code here.
Comment #4
damien tournoud commentedClosing this, 'language' should be a language object, not a language code, period.
Comment #5
hass commentedTHX for your help. I will try again.