I have a rule that checks when a new role is added to the user. The rule triggers when the updated user has a role and the unchanged user does not have that role (meaning the updated user has a new role assigned to it).
What happens is that the rule trigger for any account update, even if the user already has the role. what I found is that the unchanged user does not seem to have the correct assigned roles mapped to it, which is what's causing the incorrect rule behavior.
I tested the following conditions on a user that has a role "Test Role" assigned.
1. The user is in a role "Test Role", and the unchanged user is not in a "Test Role". This will always return true, even if the user already "Test Role" assigned before running the test. So, the rule gets triggered for any change in the user's profile, which is not correct.
2. The unchanged user is not in "Test Role". This always returns true.
3. The unchanged user is in "Test Role". This always returns false.
Looks like the unchanged user role is not picking up the actual roles assigned to it. Please check the role values assigned to unsigned user.
My site is currently sending emails for any account change when all that's needed is a notification when a new role gets added.
Thanks!
Comments
Comment #1
fagoi think this is a duplicate of #327781: unchanged user is getting changed roles - let's handle that in the other issue.
Comment #2
fagoi think this is a duplicate of #327781: unchanged user is getting changed roles - let's handle that in the other issue.
Comment #3
fagoi think this is a duplicate of #327781: unchanged user is getting changed roles - let's handle that in the other issue.