Closed (works as designed)
Project:
LoginToboggan
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2007 at 00:42 UTC
Updated:
21 Aug 2013 at 21:50 UTC
I am using instant login after registration and I want the user to get redirected to the contents of ?destination after registering, so I added this two liner.
If you want the default login form to add ?destination to the registration button, add this to your hook_menu in the !$may_cache section:
if ($_GET['destination']) {
global $_menu;
$_menu['items'][$_menu['path index']['user/register']]['query'] = 'destination='. $_GET['destination'];
}
| Comment | File | Size | Author |
|---|---|---|---|
| registration_redirect_destination.patch.txt | 973 bytes | JacobSingh |
Comments
Comment #1
hunmonk commentedi'm not so sure i like this. it seems like it could lead to unintended behavior.
also, can you explain a clear use case for this?
Comment #2
JacobSingh commentedSure, on most websites, when a user wants to do something they cannot do as an anonymous user, the site offers them the ability to login or register. If they login, they should go back to what they are doing. We shouldn't send them somewhere else and confuse them. The point is for them to get where they want to go. If they register, we want the same behavior. Registration should not impede what a user was originally intending to do. Of course there are plenty of examples out there, just about any e-commerce site or social networking site (except myspace - which is not IMO a usability case study) :)
Hope that helps,
Jacob
Comment #3
hunmonk commentedif immediate login is enabled, and i use the url
http://example.com/user/register?destination=foo, then i'm already redirected tohttp://example.com/fooafter registration, because of the way FAPI and drupal_goto() work.i see no necessary change here.
Comment #4
JacobSingh commentedTry it, didn't work for me.
Comment #5
hunmonk commentedthen i'm assuming that you're either using the incorrect URL, or there's a setting messed up somewhere. works as advertised on my local dev box.
Comment #6
JacobSingh commentedYes you are right, and I am crazy, and I have to quit working. :)
Sorry to bother you, it's time for a beer.
Comment #7
wwwoliondorcom commentedHi,
Have you found a reliable solution to redirect to previous page ?
Thanks for help.
Comment #8
halloffame commentedAfter over 3 years still no solution?
Comment #9
hunmonk commented@evilgenius: check the status of the issue -- there is no problem to begin with.
Comment #10
khu commentedHi,
Could you elaborate upon where I can put the lines of code you mentioned in the issue summary?
Do I alter the core module or do I put the codes in a hook_menu function of a custom module?
I am using D7.
Thank you for the help!
Comment #11
sszawlim commentedHello,
how do i make this work in drupal 6?
I want to send user back to the previous page, after they register the account.
Thanks,
Sam