If you have a link to a redirect that is then translated, language path checking breaks. Example:

I create a page at /about-us.
I create a link from the home page to /about-us.
I update the node to use /company/about-us which creates a redirect from /about-us to /company/about-us.
I translate the site using content translation and path prefixes.
A translated version of /company/about-us becomes /es/empresa/sobre-nosotros.

My translated link on the translated homepage tries to go to /es/about-us and 404s even with the global redirect language path checking enabled.

It needs to follow the redirect in english from /es/about-us to /es/company/about-us, then the global redirect language path checking can take it from there.

I have a patch for this that I will post.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tnathanjames created an issue. See original summary.

tnathanjames’s picture

j4’s picture

Hi I get this error when i attempt to use the patch:

Fatal error: Call to undefined function redirect_load_by_source() in C:\Users\Jaya\Sites1\devdesktop\ashoka-global-redesign\sites\all\modules\globalredirect\globalredirect.module on line 149

Thanks!
Jaya

tnathanjames’s picture

My patch doesn't check for the redirect module before using a function from it. That should be added to the patch. Enabling the redirect module should make the error go away after applying this patch.

Chris Matthews’s picture

Status: Needs review » Needs work

My patch doesn't check for the redirect module before using a function from it. That should be added to the patch.

DamienMcKenna’s picture

Reworked so that piece of logic is only triggered when the Redirect module is installed.

I guess ideally that would be handled via a hook or something..