login_destination uses a background redirect that does not include the locale. With a multilingual Drupal configuration, when a specific locale prefix such as en/ or fr/ is not provided in the URL, Drupal uses the default locale specified in its localization settings.
The redirect destination is located in the login_destination_get_destination() function on line 22 of login_redirect.module:
function login_destination_get_destination() {
return url($_GET['q'], "destination=login_redirect");
}
This is what I propose, and it has worked well for me so far, but it should be tested further (particularly on a unilingual configuration) before a patch is submitted:
function login_destination_get_destination() {
global $locale;
return url($_GET['q'], "destination=" . $locale . "/login_redirect");
}
This bug affects both the 5.x-1.0 and 5.x-1.x-dev versions (to date).
Comments
Comment #1
klance commentedAfter some thought, here's what I did instead:
That way, the locale is added if needed and omitted if not, and whatever else needs to be added, will be. This is only necessary because the url() function doesn't act on what follows "destination=" in the main url.
Comment #2
rsvelko commentedyup. wise.
the 5.x branch needs a lot of work ...
Comment #3
ddrozdik commentedVersion 5 of the module is not supported anymore.