Posted by druroot on February 17, 2009 at 7:24pm
I'm trying to use rules to execute some code when a user logs in, which works perfectly when users login via the user login page. The problem comes up when users try to login via the user login block, which doesn't fire the user login actions. I've been looking around in the code to try to find where the problem might be so I can write a patch, but I can't seem to find it. Any ideas? Below you'll find my rule export, this is a very simple rule created just to test out this issue.Any ideas?
array (
'rules' =>
array (
'rules_3' =>
array (
'#type' => 'rule',
'#set' => 'event_user_login',
'#label' => 'Profile Redirect',
'#active' => 1,
'#weight' => '0',
'#status' => 'custom',
'#conditions' =>
array (
),
'#actions' =>
array (
0 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Execute custom PHP code',
'module' => 'PHP',
'eval input' =>
array (
0 => 'code',
),
),
'#name' => 'rules_action_custom_php',
'#settings' =>
array (
'code' => 'drupal_goto(\'node/5\');',
'vars' =>
array (
),
),
'#type' => 'action',
),
),
),
),
)
Comments
hm, not really. What does
hm, not really. What does the rules debug log say?
Debugging info?
I turned on the rules debug but I don't see anything in the watchdog table, is there an article somewhere explaining how to use the rules debug feature?
the same problem...
hi ...
I've the same problem... My rule redirect a particular role 'maestra' to a specific node...
The problem is the same of DruRoot... with the user login page it's all ok but with login block no...
The rules debug log for login block is the seguent:
0 ms "User has logged in" has been invoked.
0.14 ms Executing the rule "login utente docente" on rule set "User has logged in"
0.4 ms Condition "User has role(s)" evaluated to TRUE.
0.56 ms Action execution: "Page redirect"
0.696 ms Evaluation of "User has logged in" has been finished.
It'd be all correct... but not redirecting action happens...
Thanks in advance for help... and sorry for my poor english
Confirmed issue
Not sure if this is listed as an issue in the Rules project yet, however, I can verify the same problem. A redirect after login rule does not work when using the user login block.
No Panels?
I've had some strage issues when using Panels and Rules together -- the page manager in ctools doesn't seem to trigger the same events as a vanilla Drupal installation does.
Just to rule out a possible error source: are you using Panels or page manager?
//Johan Falk, NodeOne, Sweden