Closed (duplicate)
Project:
Global Redirect
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Aug 2008 at 11:22 UTC
Updated:
5 Sep 2008 at 11:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
Freso commentedAre you using the Locale or Content Translations modules? If so, it's most likely related to #216271: Endless loop with translation (D6) which contains discussion on it, as well as a few workarounds.
Comment #2
cdale commentedI had a similar problem, except it would not only be for /admin urls, but other urls on the site too. We actually created a custom language and set that to be the sites default language, but because our new language had a prefix, almost none of the paths worked. I think '/' worked, and so did '/admin', but only when we were logged out.
I tracked this down to an if check near the end of the globalredirect function call, that checked when the language prefix was not empty, if the 'prefix/alias' was equal to the requested path, which of course, it wasn't, because we were using the default language, which had no prefix, so alias was our path.
Basically, this check would then redirect to $alias, even if the current path we were on, was $alias. Hence, the redirect loop.
I'm not too familiar with this module, but I've attached a patch that I think should fix this issue without any side effects. it simply adds an extra check, so we don't redirect to the path we're already on.
Comment #3
nicholasthompsonHmmm... I wonder if there is a better way of "wording" this...
Yours:
If the language prefix is empty, then this effectively becomes:
Comment #4
cdale commentedhmmm. I hadn't though of that. I only saw the part of the issue that causes the infinite redirect. What about something like the following. It says the same thing, just 'worded' differently.
Comment #5
strangeways commentedHow about this:
That should be logically equivalent (right?) and will let you remove the ternary operator from the condition.
Comment #6
cdale commentedI think this is actually a duplicate of issue Endless loop with translation (D6), but I'm not enough across it to be 100% sure, so I might leave it up to someone else who is to make that call. It does seem however that the latest patch in the above issue covers this one.
Comment #7
nicholasthompsonThis does appear to be an issue with language prefixes - marking as duplicate of #216271: Endless loop with translation (D6).