2

I have created a new pattern for a specific content type, and did not select any language at the /admin/config/search/path/patterns/XYZ page so that it would apply to nodes in any language.

What I want is for this pattern to be available in every site language. However, when I create new content the alias created has language set to English, and if I navigate to /fr/new-alias it gives 404. I need to manually edit the created URL Alias and set language to "None" for it to work.

I don't see a way to specify this in the pathauto rule. Is it possible or is their a hook I can use in a custom module to force this somehow?

2

This is currently not possible.

Pathauto always uses the language of the entity, just like the node edit form does.

This is a pretty common scenario and there are feature requests for it, for example: https://www.drupal.org/node/2775275.

There is also a related core issue, about allowing that for manual aliases as well: https://www.drupal.org/node/2689459.

What it needs now is someone to work on those. If you have a budget, you could offer a bounty for someone to work on it. The core issue has a needs review patch, so you could help to test that, that would also help if forward.

I'm considering to implement it in pathauto following the same rules as the core issue suggests, based on whether the path field is translatable or not. That shouldn't be too hard to implement, but it will also need tests.

Disclaimer: I am a (the) pathauto maintainer, you can also contact us (my company) to work on it.

  • Thanks Berdir but don't really have a budget. Might just hack a little cron job which wipes the lang column in the urlalias table meeting certain conditions. – Nic Aug 11 '16 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.