We have a content type with translatable field: Description (using Entity Translation).

We add a new node in en: Foo, the url from Pathauto will be: “article/foo” and we can access it also from “node/45”.
Without adding translation we can go to the URL “xx/node/45” (where xx is a language) and we can see or not the English content (depending the configuration of Entity Translate). But the Pathauto doesn’t create a URL alias for this URL (like xx/article/foo).

It’s obvious that there is no translation so that’s the reason the Pathauto doesn’t create any path alias but the content can be accessed by the visitors. How we can fix that (so we can have a xx/article/foo alias without the translation)?
(Sorry, but I don’t know if this is a support request or a feature request)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Bohus Ulrych’s picture

Hi all,
I have same issue.
There are 3 variants how URL could be displayed (for e.g. English (default), Czech languages):
1) node is Language neutral
English URL is OK
Czech looks like /cz/english-version-url
2) node is in English, no Czech translation
English URL is OK
Czech looks like /cz/node/nid
3) node is in English, Czech has translation too
English URL is OK
Czech is OK (looks like /cz/czech-version-url)
Goal is to have for variant 1 and 2 also nice Czech URL. This is needed e.g. for the easiest Google Analytics reporting.
(NB I think that variant 2 is solved in Pathauto i18n)

My approach is to enable option on the content type level to enable aliases creation for all three mentioned variants and for all existing languages. Alias creation can be enabled even for content types without enabled entity translation.

After applying path you will see new check box on the content type edit page / Publishing options. Then you can update node of such content type and check table `url_alias`if all aliases were generated correctly.
This patch seems to be working good in my environment. But more testers are needed.
!! you have to also apply this patch for _pathauto_existing_alias_data()

PS This is my first patch so I hope what I made it right way.

roderik’s picture

Status: Active » Needs review
Related issues: +#2743685: Pathauto update for all translations for a single node

(not contributing. Just changing issue state because it has a patch)