Login actions are invoked properly when login in from the login page, but the same actions are not invoked when logging in from the login block.

Comments

mitchell’s picture

Title: login action not invoked by block » login action not invoked when user logs in through login block
Version: 6.x-1.0-beta4 » 6.x-1.0-beta5
Component: Provided module integration » Rules Engine
Status: Active » Postponed (maintainer needs more info)

I've never had this problem. Can you please try again with the latest release?

fago’s picture

Status: Postponed (maintainer needs more info) » Fixed

Works for me too, so please reopen the issue if the problem persists.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dddbbb’s picture

Version: 6.x-1.0-beta5 » 6.x-1.4

I'm still getting this problem with 6.x-1.4

dddbbb’s picture

Version: 6.x-1.4 » 6.x-1.x-dev

Just confirmed that I still get the problem with 6.x-1.x-dev as well.

donatello’s picture

i have the same problem and i don't really see how we can provide more info.
Event is not fired when using login block, but works when using full page login form.
I'm on 6.1.dev

is there a fix for this?
thanks a lot

tobiberlin’s picture

Same here but for me to log in does not trigger the rule even when I log in by the form either. I have debugging enabled and I just see that the rule is triggered when I log in as admn - when I log in as any other user no debugging is shown.

**edit**

Ok... for me it is solved: looking at the reports/ watchdog I found that there was a mistake in the rule

rahulshah_1988’s picture

I am having the same problem. All other events are getting captured except the 'User has logged in'. I am using LDAP module to my website for user profile values.

MarcElbichon’s picture

Component: Rules Engine » Rules Core

Seems thant events.inc is not loaded so rules_user_login is not fired.
I moved this function in rules.module and this is working.
I use CAS module which do user_login in hook_init. Maybe this is this problem.

rahulshah_1988’s picture

Hi,

Can you elaborate exactly how you did it? It worked for me before but suddenly I noticed that only "User has logged in" event is not firing. Not sure why?

MarcElbichon’s picture

user_login hook is defined in events.inc which is loaded in rules_init (so by hook_init).
CAS module do user_login in hook_init too but its weight is smaller than rules weight so when hook_user_login is fired, rules_init has not been processed yet.

To force rules_init to be processed first, i do in a module :

function mymodule_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'init') {
    $group = $implementations['rules'];
    unset($implementations['rules']);
    $implementations = array('rules' => $group) + $implementations; 
  }
}

Works for me

EDIT : Oops, my bad, this is only for Drupal 7
For Drupal 6, you can include modules/events.inc in your module

jpwester’s picture

The code in #11 helped me immensely. I am using Drupal 7 with Shibboleth instead of CAS, but my scenario is exactly the same.

My question is, is this an issue with the Shibboleth or the Rules module? Or is the independent module that only alters the weight as is done in #11 the best/only solution?

MarcElbichon’s picture

I think this is rules issue. I've already opened one (#1853704: Force rules_init to be first).

Plecto’s picture

Issue summary: View changes

I encoutered this issue too.
I'm using the following configuration of Drupal:
- Drupal 7.24
- Shibboleth authentication 7.x-4.0
- Shibboleth User Provisioning 7.x-1.0-beta4
- Rules 7.x-2.6
The solution proposed by MarcElbichon works, but someone wrote of possible sideeffects.
Do you know if the problem has been solved by more recent versions of the Rules or Shibboleth modules?