Hi

I installed a site with Drupal 7 and tried to configure, but I have some troubles with pathauto.
The default language is English and I installed another language (French).
In the URL Alias configuration, I defined english nodes pattern as [node:title] and french one to fr/[node:title].
If I create a page and use auto alias, the aliases are created properly.
I can access the page in english (http://myserver.com/home), but if I try to open the french alias (http://myserver.com/fr/accueil), I get a 404 error.
The language switcher link provide a link like : /node/2

I tried to set french as default language and adapting the URL Alias parameters and I could access http://myserver.com/accueil, but the problem happens now for the english page.

It's like if Pathauto could not get the language aliases properly.
I tried to install the module "pathauto_persist", that I saw on a post about that subject, but no change.

Any idea ?
Thanks

Comments

thinkinghuman’s picture

Hi, Im not sure if this helps you, since Im writing you from a D6 experience:

Nodes have a language. Check whether the language of your node is set to french, and whether the language of your alias is also french. I would use phpMyAdmin and look at the nodes table and the url_alias table.

Best, Sina Falahati

vidry’s picture

Hi

Thanks for your answer. I already checked that and everything is fine.
It seems it's a bug with the new version in Drupal 7.

Thanks anyway

johnste’s picture

Did you find an answer to this problem? I'm experiencing this issue right now.

vidry’s picture

I couldn't make it work, so I manually define the page's URLs...
Maybe it will be fixed in a next version.

benoit.pointet’s picture

same here

thomsonj’s picture

In the database table "url_alias", change the value for "Language" to "und". About 60% of mine weren't working, this seems to address it. Will look for a cause/better fix if time permits.

MPeli’s picture

I had a similar problem. Url aliases did not appear for administrator. I had to modify data in url_alias table with following sql query

UPDATE `url_alias` SET `language` = 'und'
Rechi’s picture

Same problem.
Updating Database would work I quess.
Any chances for a better fix?

achesser’s picture

Indeed, I've tried that UND option and the pages are being *found* but unfortunately, everything but the central body text of the article itself is coming up as being in the default language.

It's a neat solution to allow the article to be found and delivered to the page, but getting all the menus and associated data to come up as my translated language is also required.

I wonder if there's a place I can set the site's language based on the language of the URL.

Maybe if I find a good place to intercept the first load of the node?
Anyone know where that happens?

shiroitatsu’s picture

In Configuration » Regional and language » Languages there are settings for text language detection. By default none of them is enabled. Enabling URL-detection solved my problem.

borodk’s picture

Enabling URL-detection also solved the problem for me.

jpsalter’s picture

Had same problem. The above SQL fixed it.

bok11’s picture

I confirm - SQL query is working also here :)

ace11’s picture

SQL update worked for me too.

NenadP’s picture

Had same problem here, multilanguage, used sql query to set all content to und. Thanks for the clue!

rocket777’s picture

It seems that the url_alias is created wrong without consideration for the language.
adding an '/es' or '/fr' before the alias does display the pages

E Ismail

vds1989’s picture

The SQL (UPDATE `url_alias` SET `language` = 'und') solved mine. Tnx!

srutheesh’s picture

If you are using internationalisation module... U might create a content translations , for each node so that it will work .

For example you are having node/1 (en/accueil ) in english , in that node you can see a tab named translate , click on that tab u can create multy language instance for other languages , like node/4 (fr/accueil) in french ..
If your default language is english node/1 can use the url like ' yourserver.com/accueil ' .
Hope you can understand what i told ..

Have a great day...

ANDiTKO’s picture

The SQL update did the trick.
UPDATE `url_alias` SET `language` = 'und'

Thank you @MPeli !

nplowman’s picture

For anyone else stumbling across the thread... there is a module that leverages the "language neutral" trick already mentioned. It has a bulk update for fixing your existing URLs, plus the option to automatically do this for all new nodes created in the future.

https://www.drupal.org/project/neutral_paths

Swati Sharma’s picture

@nplowman https://www.drupal.org/project/neutral_paths did fix the problem for me. But after doing the bulk updates and setting all the nodes to language neutral, the Url Alias set on the nodes are no longer visible on the node edit form. I can still see the entry in the url_alias table, but on editing the node, the url alias field is blank. Any idea on this?

Steps to reproduce,

1. Create a new content. Uncheck "Generate automatic alias" and add a url alias eg "content/my-alias". Save the node

2.   Navigate to admin/config/search/path/language_settings and click on "Reset to Neutral"

3. Hit the node created in step 1 with the alias. <domain>/content/my-alias. Edit the page. Check the Url Alias field. It shows blank.

Thanks,

Swati

DrupalGideon’s picture

I had this same issue but fortunately there's a patch at https://www.drupal.org/project/neutral_paths/issues/2161745 which works just as well in a custom module as it does patching this module.

Formerly SkidNCrashwell. Changed my username to reflect my Twitter handle.