I have a site set up with English and one other language (Filipino). Filipino is the default language, and language detection is set as path prefix only. This allows me to make the language switcher block available for the admin user.
I have just installed Drupal for Facebook Connect module, and found that with the full installation, I got thrown into a redirect loop when switching to English. I have sort of solved the problem by installing 6.x-1.5 which means I don't get the redirect when I am in the admin pages, however I get the same problem if I try to switch languages anywhere else.
I have also reported this problem under the Drupal for Facebook issue pages.

Comments

DanilaD’s picture

Did you try to disable the Drupal for Facebook module? I have similar problem, but even if I switch off all of the modules of Drupal for Facebook, the problem stays there.

So it is probably not caused by "Drupal for Facebook".

Output from Firefox Web Console in my case:

[14:53:56.091] GET https://www.example.com/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 877ms]
[14:53:56.972] GET https://www.example.com/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 679ms]
[14:53:57.695] GET https://www.example.com/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 634ms]
[14:53:58.332] GET https://www.example.com/en/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 647ms]
[14:53:58.982] GET https://www.example.com/en/en/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 697ms]
[14:53:59.681] GET https://www.example.com/en/en/en/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 734ms]
[14:54:00.420] GET https://www.example.com/en/en/en/en/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 917ms]
[14:54:01.340] GET https://www.example.com/en/en/en/en/en/en/en/en/view_data/%D0%97 [HTTP/1.1 301 Moved Permanently 669ms]

DanilaD’s picture

Status: Active » Closed (duplicate)

This is duplicate of #1234014: Infinite redirect when using user-language

I've modified the patch described there a bit to work for 6.x-1.5 version. Edit globalredirect.module, after this comment:

  // Compare the request to the alias. This also works as a 'deslashing'
  // agent. If we have a language prefix then prefix the alias

Replace the existing if block with the new one:

  if ($_REQUEST['q'] != $prefix . $alias) {
    $break = FALSE;
    $noalias_request_path = str_replace($alias, '', $request_path);
    // If we have a prefix language, and an alias, don't go into redirect loop.
    if ($langcode && empty($noalias_request_path)) {
      $break = TRUE;
    }
     // If it's not just a slash or user has deslash on, redirect
    if ((str_replace($prefix . $alias, '', $request_path) != '/' || $settings['deslash']) && (!$break)) {
       globalredirect_goto($alias, $query_string);
    }
  }
joel_guesclin’s picture

Did you try to disable the Drupal for Facebook module?

Not exactly. But the site has been running quite happily for some time using Global Redirect, and it was only when I installed Drupal for Facebook that the problem occurred.

guruslot’s picture

Confirm that issue with Drupal for Facebook module, when applied the code above it works but deslash become broken.
Have you tried the code from the thread #153950: Endless loop with i18n

guruslot’s picture

DanilaD, this code works as should be. The only one issue is that it breakes prefix i.e. if request example.com/contact it will not redirect to example.com/en/contact as before.