If the original path in _pathologic_replace() already contains the leading path prefix and if at the same time the cached langcode is in the language list, then the prefix won't be split from the path and as a consequence that language prefix will be present twice afterwards.
I'll provide a patch to fix this is a minute.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | language_prefix_is_not_2628348_4.patch | 1.08 KB | jurgenhaas |
| #2 | language_prefix_is_not_2628348_2.patch | 1.08 KB | jurgenhaas |
Comments
Comment #2
jurgenhaasLet's always check if we can split a leading language prefix and only finally fall back to use a potentially cached language object to the parts array.
Comment #4
jurgenhaasA patch with a final empty line is never a good idea ;-)
Comment #5
PascalAnimateur commentedPatch #4 works flawlessly! I came up with a similar solution before discovering this issue... (the last check to make sure
$parts['language_obj']is set is good)Using this patch also allows linking to different languages than the current one, which is great!
Comment #7
Garrett Albright commentedOkay, committed #4. Didn't push a corresponding patch to the D8 branch since it doesn't seem applicable.
Thanks!