Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be great to have a new Role change event for React on event so that we can perforn an action when a role of a user changed whether a new role(s) assigned or removed. Something similar to Role Change Notify module. Thanks!
Comments
Comment #1
TR CreditAttribution: TR commentedYou can do that yourself. Either react on user update then use data comparison to see if the unchanged user role set differs from the changed user role set. Or you can implement hook_user_update(), do the comparison in there, then fire a new event that you defined yourself.
There doesn't seem to be any interest in putting this feature directly into Rules. Think about it, if you had a different event to fire on every single user property change, then you would need a LOT of new events. Roles are just one of the things that can change. But Rules doesn't need all those new events because it already has a way to check this with the data comparison.