The description for the Language Path Checking setting says "If enabled, the module will check that the page being viewed matches the language in the URL or the system default. For example, viewing a French node while the site is in English will cause a redirect to the English node."

To me, this sounds like it should only redirect when viewing a node, not editing, deleting, translating etc. I've looked through the code, and afaict, it's simply a matter of changing the regular expression that checks the current path.

Is this the intended behavior? If it is, I propose changing it, or maybe provide an additional setting that allows us to ignore the redirect when we're not actually viewing it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

olofbokedal’s picture

Provided patch changes the regular expression to match node/123, node/123/view and node/123/.

olofbokedal’s picture

The regex in the previous patch didn't work as I suspected, so here's a new one.

Schnitzel’s picture

nice! Had extactly the same problem and the patch at #2 works charming!

thanks

Cyclodex’s picture

+1 really nice. Just in time :D Thx

Frederic wbase’s picture

I've just installed the dev version of this module and it seems to be working now.

Can i asume that this fix has already been commited to dev? If so, can we close this issue?

olofbokedal’s picture

Simply by looking at the code, I can tell that the patch from #2 hasn't been applied.

Haven't tried it out though, maybe it has been fixed in another way?

Carl Johan’s picture

Status: Active » Needs review

This issue hasn't been fixed in 7.x-1.5 and the patch still applies.

edux’s picture

Still the issue hasn't been fixed, I think this is a bug that needs to be reviewed, the patch in #2 did the job for me.

yannickoo’s picture

Status: Needs review » Reviewed & tested by the community

Works fine so let us set the status to RTBC :)

nicholasThompson’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in dev - Also updated the tests to remove the 3 node edit language redirect tests.

Thanks guys.

yannickoo’s picture

Finally! <3

Status: Fixed » Closed (fixed)

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

  • Commit 3f6c69c on 7.x-1.x, master, 8.x-1.x authored by olofjohansson, committed by nicholasThompson:
    Fixing #1399506 - only language redirect nodes being VIEWED, not edited...
  • Commit e7debe9 on 7.x-1.x, master, 8.x-1.x by nicholasThompson:
    Removing the node edit language path tests. These no longer apply due to...
mas0h’s picture

Issue summary: View changes

What if the opposite is needed, I mean to redirect to the source language only when editing content, not viewing?
Thanks!

stefan.r’s picture

@mas0h: if you want to do this while editing content as well, check out Node Edit Redirect

stefan.r’s picture

Category: Feature request » Bug report
Priority: Normal » Major

This caused infinite redirects on the node edit form when other modules are already changing the interface language (see: admin_language).

Yet another reason to tag a new release, since the last one is from 2012 :)