Closed (fixed)
Project:
Login Destination
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
17 Jun 2006 at 11:09 UTC
Updated:
20 Jan 2007 at 15:01 UTC
When logging in from a block (that is: not from the login page), the login fails and I'm redirected to the login page, where logging in succeeds.
It doesn't give any warnings about user authentication (and it shouldn't because I give the right credentials).
Is there a mistake in the form_id? what's wrong? Has anyone else got the same problem?
minor mistake to be fixed for the sake of clean code: the module doesn't have a closing tag for php ( ?> )
Comments
Comment #1
z.stolar commentedI partialy solved the problem, but I still don't get it...
the original code:
<?
function login_destination_get_destination() {
// customize the path as desired.
$path = 'archive';
return url('user', "destination=$path");
}
?>
What I did was to change the <? return url('user', "destination=$path"); ?> to <? return url('main', "destination=$path"); ?> where 'main' is an alias for my main node.
Why does it work?!
Comment #2
z.stolar commentedOoops... code was ommited...
So... the original was:
And I changed it to be:
<?php return url('main', "destination=$path"); ?>where 'main' is an alias for my main node.
Comment #3
z.stolar commentedSometimes it's nice to talk to yourself. After all, it's not often that you get to talk to someone as inteligent as you...
I beleive I found the problem with this function:
While the original line was:
return url('user', "destination=$path");,it should actualy be:
return url($_GET['q'], "destination=$path");Am I right?
Comment #4
calebgilbert commentedIf anyone has any problems with this module they can just hardcode the url instead of using the $path varialble (which in retrospect seems like it might be unnecessary).
For example:
turns into:
Comment #5
ardas commentedGreetings,
I became a maintainer of this module and am going to improve it. Please download a new 4.7 release in a day and try if this defect still exists. I changed redirection logic and it fixes several problems.
If login doesn't work from a block it may be another big core bug which was fixed in Drupal recently. Please, try to login without login_destination and find out will it work or not.
>> minor mistake to be fixed for the sake of clean code: the module doesn't have a closing tag for php ( ?> )
It is not a mistake - it is a Drupal coding standard. It is suggested to ommit PHP closing tag.
Thanks.
Comment #6
ardas commentedFixed for now. Please, try the new version.
Comment #7
(not verified) commented