Closed (works as designed)
Project:
Rules
Version:
7.x-2.9
Component:
Rules Core
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2015 at 23:08 UTC
Updated:
31 Mar 2019 at 15:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
paramnida commentedComment #2
jigish.addweb commentedChecked this with same version of rule, and unable to reproduce issue. Please find attached screenshot for same and check whether you have missed any configuration for rule.
If you still face same issue then please send me screenshot where you are facing issue.
Thanks!
Comment #3
sath01 commentedI can confirm this behaviour.
I ran a test with separate rule triggers on "before saving user account", "after updating an existing user account" and "user logged in" events which then logged to watchdog (and put up a message). The "after updating an existing user account" event does fire with each user login.
I had assumed it was something to do with the system updating the user's last login time, but that probably shouldn't fire the event anyway?
Comment #4
skulegirl commentedI'm also seeing this behaviour. It happens for the rule on my production site, but not for the exact same rule on my dev (localhost) site. There may be a few differences between the two sites, but I'm not sure what they are - they won't be big. I'll see if I can dig and figure out any significant difference that could cause this behaviour.
Comment #5
skulegirl commentedFYI - I've determined what the source of my issue is, and it's not related to this module. The ip2country module that I have installed was calling user_save to update the user's country after they logged in, thus the reason that the "after updating an existing user account" event was being triggered. (It doesn't happen on my localhost because it can't determine country from the ip.) You might try doing a grep in your modules directory to see if you have any modules that are calling user_save on login.
Comment #6
skulegirl commentedAlso note: I ended up resolving this by just adding a condition to my rule:
Data to compare: [site:current-page:url], Data value: [account:edit-url]
Then it only fires if the reason the user is being update is because they actually were updating their account data on the account edit page.
Comment #7
tr commentedIn this case, if you are using one of the many modules which alter the user account on login, Rules is doing the correct thing - there should be an "After updating an existing user account" event, because that is what is happening. I think #6 presents a good solution which, by adding additional conditions, more specifically and more accurately represents the situation that you want to test for.
Comment #8
bassplaya commented@skulegirl Thanks. That worked for me too.