I have a multilingual site with 3 languages. The default language has no path prefix and language negotiation is set to show pages in the users language or with no language preference (a fairly standard multilingual setup). I use aliases for all my nodes. So, for example, I might have the following node => aliases:

node/1 => some_page_alias (language = en - no prefix)
node/2 => some_page_alias (language = fr)
node/3 => some_page_alias (languge = ie)

On another page, I create links to each of these nodes using pathfilter:

internal:node/1
internal:node/2
internal:node/3

Pathfilter ends up inserting the following links:

/some_page_alias
/node/2
/node/3

Only one of the languages gets the correct, aliased link inserted. This is a real problem because block visibility is determined by the path that a page is accessed by. So, if a user clicks on the first link, they will be taken to /some_page_alias all the blocks will display fine. However, if a user clicks on either of the other links, they will be taken to the node using it's node url, within the current version of the site, and blocks will not display.

What should happen is that pathfilter should always use use the alias when possible - so it would generate the links like this instead:

/some_page_alias
/fr/some_page_alias
/ie/some_page_alias

The attached patch attempts to do this by using i18n_node_get_lang() to find out what language the referenced node is in and passes this information to the url() function to ensure the url is generated correctly.

CommentFileSizeAuthor
pathfilter-i18n-node-alias.patch1.72 KBmrfelton

Comments

mrfelton’s picture

Status: Active » Needs review
mattiasj’s picture

Great work!

mrfelton’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Needs review » Fixed

This is applied in CVS.

mrfelton’s picture

Status: Fixed » Patch (to be ported)

marking this as 'to be ported' so that I don't forget to backport this.

mrfelton’s picture

Status: Patch (to be ported) » Fixed

Backported to D5

Status: Fixed » Closed (fixed)

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

andread’s picture

I don´t know if this is the right place to post, but F.Y.I.:

I have the same problem & I haven´t installed Pathfilter.
It might be something with clean urls and/or automatic urls, & the combination of Internationalization.
Although I have not found the solution for the problem these places, so I will install Pathfilter, just to solve this problem... :)
So thanks for the solution. :)

Br,
AndreaD