(Tested also in 6.x.-2.x-dev)

I have Drupal with 2 languages, English and Spanish, but with the porpouse of having the interface in 2 languages. The content is only in one language, so the alias is only one. So my problem is slightly different than this other issue [Path only works for one language].

Example:
Interface in English. I create a story called "Example title", having the pattern for Story paths as blog-noticias/[title-raw] , so the story created has this alias:
http://localhost/drupal/blog-noticias/example-title
If I go to he front page, the title of this story links to that alias.

I change the interface to Spanish. and now the title of this story links to /node/12 and even if I try to put in the browser the previous alias doesn't work (404 error)

If I go to list the aliases I can found this line

"blog-noticias/example-title node/12 Spanish editar borrar"

If I edit the line, and select alias for "All the languages".. then it works!

But I don't want to make this manually every single time that I publish some content.
Any solution?

Comments

dvinegla’s picture

corbacho’s picture

Thank you dvinegla

I have installed the module Preserve Language, so now when I publish new content, it is in a neutral language and alias works perfectly.

Exactly, this module offers you this option, that is suitable for me:
Fix Language-Neutral. Sets Language-Neutral for *new* nodes with no multilingual support. Drupal default behaviour is to set them as Default site language.

By the way, this module fixs "new" content, the old content (only 15 nodes) I had to change manually, going one by one clicking "edit" and "save" so it changes automatically to a neutral language.

NicoDruif’s picture

I ran into (almost) the same problem... but was able to fix it with following settings:

pathauto node settings: [title-raw]
language handling settings: second one, using only path prefix
non-default language prefix setting (in my case English): en

and voila: all previously set (auto)paths worked again, because it now really switches language, thanks to the prefixes on non-default languages!

morningtime’s picture

When I bulk update url aliases, with either content module, or VBO bulk updates, I noticed my aliases missed their language settings, in an i18n environment. This caused duplicated aliases to get -0 or -1 added. Like contact.html-0, contact.html-1.

The problem is, that function pathauto_node_operations_update() calls

pathauto_create_alias('node', 'bulkupdate', $placeholders, "node/$node->nid", $node->nid, $node->type);

Shouldn't this be:

pathauto_create_alias('node', 'bulkupdate', $placeholders, "node/$node->nid", $node->nid, $node->type, $node->language);

Notice the part $node->language

Now all my bulk updated aliases get their language setting, and results contact.html for English and contact.html for German. No more -0, -1 at the end.

Dave Reid’s picture

@morningtime: That has been fixed in CVS now.

Dave Reid’s picture

Status:Active» Fixed

As per some of the previous comments, sounds like this has been fixed/solved.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.