4
votes

In Drupal 7 multilingual site, when a node is created with language set to something except "Language neutral", its alias does not work (error 404) when site language is different from node language.

You can avoid this problem changing alias language to "All languages" from alias edit page (admin/config/search/path).

This is very annoying, because you have to do this for every new node with language support. Moreover, when Bulk update changes some alias, this setting is lost.

Is there any way to get "All languages" to be set for every new alias created?
Is there any way to get "All languages" to be set for all alias already created?

2

2 Answers

3
votes

you should add this code to your template.php

function youtheme_node_presave($node) {
         if ($node->type == 'nodetype') {
         $node->language = LANGUAGE_NONE;
        }
}

this basically will save your nodes to neutral language ;) change nodetype or add more if u need.

0
votes

The above did work for me (from: http://bengoodyear.com/blog/drupal-7-cracking-the-multilingual-front-page-nut) but this did.

Make sure you have the modules Variable and Variable Translations switched on. Goto admin/config/regional/i18n/variable Select ‘Default front page’ from the list, save settings. Goto admin/config/system/site-information, you’ll notice a block of text there saying something about some of your settings being multilingual variables and a list of links for the languages you are running which allow you to set the settings for each language.