I'm building a website with de default language set to Dutch. Because the site is not a multi language site all the nodes are created with the language 'und'. With every node comes a URL-alias. The site is set to Dutch so the URL alias is created in Dutch.

If I create a node with a URL in it (like /node/2012), it won't be corrected to 'content/new-year'. Only when I go to the URL alias and set the language of the URL alias to undifiened, save the node again, the URL is changed to it's alias.

I've checked the code and found the following:
On line 161 of pathologic.module the settings are gathered. I dumped this variable and found that the language is set to und, based on the node value (my best guess). The value appears on line 41 but I'm not shure where the value comes from.

On line 293 this value is used to select the URL alias but because langcode of the node is used (und), it wont find a alias (because it's 'nl') so it leaves the URL untouched.

As a test I changed the following in the file (line 161 - 162):

$settings = drupal_static('_pathologic_filter');
$settings['langcode'] = 'nl';

After updating the node everything works.

I don't have a fix at this moment. I think there are some options here:
1. Check if site is multilanguage (did not found a function to check this, could check if module is active?), if not, use site default language to check for alias, no results, use node language (so und)
2. If node is und, use und, no results, use site default language, no result, leave url untouched

As long this is nog fixed I'm going to stick to 1.4.

Comments

Garrett Albright’s picture

So you're saying that nodes can have different aliases based on language? Wasn't aware of that… I've been pretty pressed for time recently, but I'll try to give this a look when I can.

h3rj4n’s picture

What i'm trying to say is that the default language applies to the aliases but not the nodes when you're not working in a multi language envirement.

So nodes are language undifiened
Aliases are language dutch in my case

Both created with default language set to Dutch.

Garrett Albright’s picture

+ pathologic-multilingual tag.

Garrett Albright’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

Is this problem still happening given the multilingual improvements in later versions of Pathologic?