Redirection stops working in latest version
aaront - December 2, 2008 - 17:29
| Project: | Login Destination |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Login Destination was working great for me with version 6.x-2.1 but when I updated to 6.x-2.3 it completely stopped working. Rechecked settings, ran update php, no luck. I have it set to redirect to the site's front page after login and that's what's no longer happening. Had to revert back to 2.1, and after doing so it's working fine again.

#1
forgot to mention - running it on drupal 6.6
#2
Same here.
Running on 6.6 as well
#3
Agreed, not working in Drupal 6.2 either.
#4
Ah so that's why it's stopped working - had tried all sorts, disabling other modules, re-installing. I'll roll back to 2.1... all working again. On drupal 6.6.
#5
6.x-2.3 doesn't work in 6.7, either -- or, at least not on my site. I also reverted to 2.1.
Any ideas on this? Seems strange that it would simply not work, since presumably people are using it -- so I'm wondering if there is some known conflict, or some type of conflict that I should be looking for in my site in particular. Thanks!
#6
I had the same problem with 6.x-2.3.
Unchecking the "Preserve destination" checkbox fixed the problem.
#7
The solution at #6 works for me. Thanks for posting!
#8
Solution in #6 does not work on my site.
Details: I have pages where you need to log in to sign up for an event, or post something. I want to show a block that says "you need to login first," with a link to login; and I want the user to return to the same page they were on, so they don't have to navigate back to the page to continue.
In 6.x-2.1 I can use the solution here: http://drupal.org/node/225890 (see comment #7) and it works perfectly.
In 6.x-2.3 it fails, whether or not "preserve destination" is checked, and instead the user is sent to the user page.
#9
We tested this on Drupal 6.8 and everything works correctly.
1. Could it be a conflict with any of your modules?
2. Be sure destination attribute is set in the URL when you are visiting the login page.
#10
could you give a bit more detail about point 2? how do you set destination attribute
#11
Hi
I do have the same problem here. Solution #6 works for me.
Installation:
Drupal 6.9
Modules:
- ACL 6.x-1.0-beta4
- Advanced help 6.x-1.1
- Backup and Migrate 6.x-1.2
- Calendar 6.x-2.0-rc6
- CAPTCHA 6.x-1.x-dev (2008-Nov-21)
- Content Construction Kit (CCK) 6.x-2.1
- Content Access 6.x-1.0
- Date 6.x-2.0-rc6
- Email Field 6.x-1.1
- Image 6.x-1.0-alpha4
- Image Assist 6.x-2.0-alpha2
- Login Destination 6.x-2.3
- Poormanscron 6.x-1.x-dev (2008-Dez-29)
- Role Delegation 6.x-1.0
- SpamSpan filter 6.x-1.2
- Token 6.x-1.11
- Upload path 6.x-1.0
- User Read-Only 6.x-1.x-dev (2008-Sep-17)
- User Protect 6.x-1.2
- Views 6.x-2.2
- Wysiwyg API 6.x-0.5
Tobias
#12
same problem; anyway solution #6 works here
#13
same problem here. the problem seems to be in the following code in login_destination_apply_redirect():
<?phpif ($_GET['destination'] != $_GET['q'] && variable_get('ld_destination', TRUE)) {
return FALSE;
}
?>
This will always return false if no destination is set, and thus no redirection to the proper login destination will take place.
#14
I think mkruisselbrink (#13) is right. In the previous revision of login_destination.module, it said:
<?phpif (!empty($_GET['destination']) && variable_get('ld_destination', TRUE)) {
?>
I can understand why there is now a check that the destination must be different than the current page, but I think the !empty check should still be there...
In other words, I think the line should read:
<?phpif (!empty($_GET['destination']) && $_GET['destination'] != $_GET['q'] && variable_get('ld_destination', TRUE)) {
?>
#15
@svdoord's code from #14 does the trick for me. Here's a simple patch that implements the fix.
#16
+1 for this patch. Works in D6.12. The module simply does not work without this patch.
#17
I found this module was not redirecting at all. I ended up using Rules module:
http://drupal.org/node/298506
#18
I applied the patch from #14, but it did not work. Here's what I'm doing:
Preserve destination: checked
PHP Snippet: checked
URL: return "http://". $_SERVER['HTTP_HOST'];
I suspect it's because I'm using a full URL instead of a path without the domain.
I use this code because my login page is under https and before I installed Login Destination, it was always redirecting to my homepage to https://www.mydomain.com. Then publishers were inserting URLs in their pages with the https instead of http. It wasn't a huge problem, but I didn't want them doing that. This code worked in Drupal 5, but not in Drupal 6.12.
Is there another way I can accomplish redirecting to and http version of my homepage?
#19
You can try using Secure Pages module: http://drupal.org/project/securepages.
#20
The Patch in #15 works for me. :)
#21
Related issue and module maintainer reply: http://drupal.org/node/292006#comment-970509
#22
Yes, #15 works.
#23
#6 worked for me too.
#24
please try if this issue is reolved with 2.5
mark it as fixed if it IS fixed.
#25
if not fixed - change it back to active... I guess it is fixed now.
#26
Confirming that 6.x-2.5 works.
Thanks rsvelko
#27
6.x-2.5 does not work for me.
In 6.x-2.1 I can send a user back the page they were on.
Has anyone successfully used 6.x-2.5 to send someone back to the same page they were on; and if so, would you be willing to post exactly what goes in each box of the Login Destination settings page? Thanks!
#28
@toddwoof: Find attached settings screenshot. With this settings when users log-in they are redirect to a specific URL. Could be any URL. Such as
<front>for front page ornode/category/page-title-here.For example
node/category/page-title-herewould redirect tohttp://your-domain-name-here.com/node/category/page-title-here#29
Attaching screenshot.
#30
Maybe I'm missing something, or didn't describe the need properly.
I don't want to redirect the user to a specific page. I want to redirect them to whatever page they were on when they logged in. If they're on the home page and they log in, I want to redirect them to the home page. If they're on some event listing page and they log in, I want to redirect them to the event page they were on; and so on.
The purpose is to allow the user to log in and not lose their place. Sometimes they want to log in to register for an event, for example. I don't want them to log in, and then have to navigate back to the event page; I want them to be redirected right where they were.
So, a fixed url won't work.
#31
Same here. I have a login link on the bottom of my forum topics and when a user clicks the link to login I'd like them to be redirected back to the forum post so they can join the conversation. Any help doing that would be great.
#32
One option would be to add a ?destination parameter to your login link. So the URL is something like user/login?destination=node/678 where "node/678" is the URL of the page the user is currently on. Then make sure Login Destination is configured to support the ?destination parameter.
#33
@toddwoof: Thanks for clarifying. Indeed setting in comment #29 is for a redirecting user to a specific page. This is not what you want.
The
?destinationparameter is able to do that. But I never tried that with Login Destination (LD). According to LD readme.txt file the LD support?destinationparameter.#34
...Which brings us back around to the issue noted in #8, above -- namely, it doesn't work.
@eternalistic: My solution for now is to stick with 6.x-2.1, and to use the solution in #7 on http://drupal.org/node/225890
But of course I'd like to be able to upgrade to the current version, which is why I'm asking what needs to be done for it to work in 6.x-2.5. Evidently something changed; but I can't figure it out.
#35
Changing status to 'needs work'. Read more at comment #8 http://drupal.org/node/341683#comment-1177305
Any volunteer to provide a patch?
I would be happy to contribute testing.
#36
Subscribe.
I'm trying to achieve the same as what is written in #30.
#37
I followed the LD configuration instructions here and this is working for me now with 6.x-2.5: http://www.interworksinc.com/blogs/scorrales/2009/07/23/taking-control-y...
This seems like the only way to get LD to support the ?destination parameter.
#38
Thanks for the instructions Sborsody.
I have updated the module
README.txtfile. Patch attached below. Any volunteer to test this patch?Patch is against 6.x-2.x-dev 2009-Oct-23
Apply this .patch from the module root directory /sites/all/modules/login_destination