When I set the destination parameter (or any parameter in fact) in the logintoboggan field 'Redirect Path on Registration' or Confirmation, it gets encoded into a nonexisting url.
When I have set
/mhp/register?destination=user
logintoboggan tries to redirect to
/mhp/register%3Fdestination=user
Which breaks the ability to give more advaced urls.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | logintoboggan.module_0.txt | 41.52 KB | dkruglyak |
| #4 | logintoboggan_support_queries_0.patch | 2.78 KB | Bèr Kessels |
| #1 | logintoboggan_support_queries.patch | 1.87 KB | Bèr Kessels |
Comments
Comment #1
Bèr Kessels commentedFirst patch. To show my direction of thinking.
Idea is to let logintoboggan_process_login() return an array with query, path and fragment, which can be passed into drupal_goto().
This patch does not yet work, it now redirects to
/path?query#destination=user
instead of
/mhp/register?destination=user
sidenote: this module has a serious problem with return values and functions returning values vs doing stuff. They are really scattered all over the place, making a simlpe change like this issue an enourmous all over the place overhaul.
another sidenote: one should never check $foo != '' instead use !empty($foo)
Comment #2
markhope commentedsubscribe
Comment #3
Bèr Kessels commentedAfter some conversation on IRC I thought that hacking some $_REQUEST[] changes in may help. Like this:
But that actually redirects us to $destination, instead of appending that to the url... grrr.
Comment #4
Bèr Kessels commentedw00t. it works on our installation with the latest patch.
I moved some return values around and removed one layer of spagetti :) so maybe custom modules calling such an PI will now break?
Comment #5
dkruglyak commentedNot sure if this is 100% related but I believe this is a different manifestation of the same problem...
I am using 'me' module, which I patched according to http://drupal.org/node/127913 (you can get the file to test).
What I have is /user/me redirect to /user/login (logintoboggan) to log in the user and then redirect back to /user/me. When logintoboggan opens the login form it grabs destination URL and shows it on login form as a text message.
I was able to temporary get rid of the problem by adding
unset($form['message']);in logintoboggan_form_alter under user_login case. However, I wonder if this 'message' could/should be preserved.Attached is my 4.7 file patched.
Comment #6
hunmonk commented@dkruglyak: you can't expect me to review a patch like that. please submit you patch in the proper unified diff format.
@ber:
Comment #7
hunmonk commented@ber: i wasn't happy with some of the aspects of your implementation, so i made adjustments accordingly. mostly, it makes more sense to use parse_url() than to do things by hand.
i've committed the change to 6.x. i kind of view this as a new feature, not a bug -- as such i'm not compelled to backport it. however, i'll leave this marked as to be ported for now. if somebody comes along and ports it before the feature freeze for 5.x, then i will review/commit -- otherwise this will be a 6.x and forward feature.
Comment #8
hunmonk commented5.x no longer supported.