The function _pathauto_existing_alias_data() currently returns the language neutral alias if there are both a language neutral and a language specific one. In such a case it should return the language specific one. The patch attached changes this behavior. Please review this patch.

Comments

ricovandevin’s picture

Issue summary: View changes

Just improved readability of the issue summary.

Status: Needs review » Needs work

The last submitted patch, pathauto_multilingual.patch, failed testing.

klonos’s picture

Title: _pathauto_existing_alias_data() should return language specific alias if there is one » _pathauto_existing_alias_data() should return language-specific alias if there is one
+  // If there are both a language specific and a language neutral alias the
+  // language specific one should be prefered.

I'm not sure if the logic should change too, but I think that this should be more like this (to account for multiple languages):

+  // If there is a language neutral alias as well as language-specific aliases,
+  // then the language-specific ones should be preferred for their respective
+  // language.

Thanx for this BTW. It's a great start to provide some sanity when it comes to paths in multi-language sites!

valentine94’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

Re-roll. Please review.

dave reid’s picture

This needs a test case to confirm that this is fixed.

bohus ulrych’s picture

Hi,
I can confirm that this patch #4 is working well and it is really helpful. Thank you!

NB. I've found similar login in path_pathauto_is_alias_reserved. Isn't needs to update too?

dave reid’s picture

chris matthews’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
donquixote’s picture

When _pathauto_existing_alias_data() is called from pathauto_create_alias(), it makes no sense at all to ever return the LANGUAGE_NONE alias, if a language-specific one was requested.

If pathauto_create_alias() is called to create an alias in a specific language in which no alias exists yet, the LANGUAGE_NONE alias will be converted into a language-specific one. This is destructive!

mably’s picture

Status: Needs review » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.