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.

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Let'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.

Status: Needs review » Needs work

The last submitted patch, 2: language_prefix_is_not_2628348_2.patch, failed testing.

jurgenhaas’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB

A patch with a final empty line is never a good idea ;-)

PascalAnimateur’s picture

Status: Needs review » Reviewed & tested by the community

Patch #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!

Garrett Albright’s picture

Status: Reviewed & tested by the community » Fixed

Okay, committed #4. Didn't push a corresponding patch to the D8 branch since it doesn't seem applicable.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.