|Status:||closed (works as designed)|
I'm creating nodes from a xml file using node_save in my own script.
My code looks like this:
$node = new stdClass();
$node->title = trim($item->title);
$node->type = "job";
$node->language = 'de';
$node->uid = $user->uid;
$node->status = 1;
$node->promote = 0;
$node->comment = 1;
$node->path['pathauto'] = TRUE;
$node->body[$language_body]['value'] = trim($item->description);
$node->body[$language_body]['summary'] = trim(text_summary($item->description));
$node->body[$language_body]['format'] = 'full_html';
$node = node_submit($node);
Like the issue title suggests I'm working with a multilingual site (en+de).
In the code example I'm creating a german node. The url alias is correctly generated by pathauto using the pattern that i specified for german "job" nodes. As long as the default language is set to german.
If I'm changing the default language to english the code example doesn't work anymore. That is: the node gets created, the alias gets created and saved in the url_alias table. But the redirection from such an alias doesn't work anymore. If I call such an alias i only get a "Page not found" error.