[development] Path Redirect Location Storage
Steve Edwards
killshot91 at comcast.net
Tue Mar 24 19:28:55 UTC 2009
I did exactly that. In my case, I was at /node/add/registration, which is where I wanted to go back to after registration/account
creation, and redirected the user to /user, i.e.:
drupal_goto('user',drupal_get_destination());
That takes the user to /mysite.com/user?destination=node%2Fadd%2Fregistration%3Fproduct_nid%3D2. If he logs in from there, he is
redirected back to mysite.com/node/add/registration.
However, if he is a new user and needs to create an account first, he clicks on the "Create New Account" link, which takes him to
/user/register (without ?destination). Therefore, when he is done registering, there is no ?destination parameter for the Forms
API, so he stays at the user screen.
The way the module does the redirect after that is in hook_form_alter(). It looks for the 'node_checkout_redirect' variable on
the user screens, and if it sees it, redirects to whatever is stored there. But, as I mentioned, since $_SESSION is wiped out at
the end of drupal_goto(), it doesn't know that the redirect needs to happen. That's why I'm looking for an alternate storage
location for that redirection location.
Steve
Earnie Boyd wrote:
> Quoting Steve Edwards <killshot91 at comcast.net>:
>
>>
>> So, can anyone give me an idea of the best way to store the URL so
>> that the user can be redirected back to where they came from when they
>> are forced to create a new account?
>>
>
> ?destination=http://sample.com/go/here
>
> or
>
> #destination='go/here'
>
> --
> Earnie http://r-feed.com
> Make a Drupal difference and review core patches.
>
> -- http://for-my-kids.com/ -- http://www.4offer.biz/
>
>
More information about the development
mailing list