Download & Extend

LANGUAGE_NEGOTIATION_NONE disregards path aliases for translated nodes

Project:Drupal core
Version:7.x-dev
Component:path.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (works as designed)

Issue Summary

If you set a path alias for a node which is a translation, and have your locale settings to LANGUAGE_NEGOTIATION_NONE, the alias is never used, and will return a 404 if you try to visit it directly, instead you just get node/nid as if there was no alias set.

This caused me several hours of headache, as documented on #204106: Test for translated path aliases.

Two options:
1. Make drupal_lookup_path() return an alias in that case - there's a patch by desbeers (and updated by me) on that issue which does this.
2. form_alter out the path field on nodes where it's going to be disregarded.

Personally I'd go for #1 - since as far as I can see the current behaviour, whether by design or not, is both completely undocumented, and to me makes no sense whatsoever.

Comments

#1

I'm favorable to #1, but the patch in the other issue is wrong: we should use any alias regardless of the language *only if* language negotiation is set to NONE.

#2

Status:active» closed (works as designed)

So in otherwords, browsing your site in English or default language, you expect to see aliases that are not for the same language? Nope, that's by design.

nobody click here