I've found that with the current (Drupal 8) version of Pathauto, it is not possible to have both custom and automatically generated aliases per translation - only per node. For example, if I have a node translated into French and Spanish, and I have automatic aliases, and set a custom alias on the French translation, that custom alias will override the aliases for the Spanish and English translations of the node, as well.
This patch takes the langcode into account, as well as the entity ID. I've tested it pretty thoroughly, but I've never gotten into the guts of Pathauto before, so please test and let me know if anything is missing. It now allows for each translation of a node to use either the custom or automatic alias.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | allow_for_custom_or-2880482-19.patch | 1.39 KB | dylanmehl |
| #10 | allow_for_custom_or-2880482-10.patch | 1.57 KB | andreyjan |
| #7 | allow_for_custom_or-2880482-7.patch | 1.36 KB | aburke626 |
Comments
Comment #2
aburke626Comment #4
aburke626Comment #5
aburke626Comment #7
aburke626Updated patch - one instance of changing `EntityID` to `entity_id`.
Comment #8
aburke626Comment #10
andreyjan commentedRe-rolled the patch for current module's version.
Comment #11
andreyjan commentedComment #13
damienmckennaComment #14
damienmckennaComment #15
damienmckennaI wonder if the tests fail because EntityAliasTypeBase::batchDelete() needs to be updated to handle the concatenated ID string too?
Comment #16
damienmckennaAlso, this needs an update script to append the langcode to 'name' values in the {key_value} records.
Comment #17
damienmckennaA quick update to be clear on what the status is on this change.
The basic functionality works correctly, so kudos to @aburke626 for digging through that!
There are a few problems with the current patch:
Comment #18
jansete commentedI think that this issue is very important.
Multiple editors working in different translations of the same node could get unexpected results if each of one check or uncheck "Generate automatic translations".
Comment #19
dylanmehl commentedThe latest patch did not apply on Pathauto version 8.x-1.11. I re-rolled the latest patch and made it compatible with 8.x-1.11.
Comment #20
mably commentedComment #21
mably commentedClosing as a duplicate of #3131794.