The title may not be the best, so hopefully this is a good enough description. I encountered this with Role Watchdog, but I can imagine it being a problem with other modules that use hook_user().
Role Watchdog uses hook_user() to monitor changes to user roles, and logs the changes.
The program flow:
role_expire_cron() calls user_save(), which ends up firing Role Watchdog's hook_user(), but Role Watchdog isn't receiving the correct information in order to record the change.
It appears that this is because Role Watchdog is expecting these parameters to hook_user(), which in my observation is standard:
$account - the original user data.
$edit - the new values to save to the user.
However, role_expire_cron() is passing a modified user object, so Role Watchdog can't distinguish the "new" from the "old," and thus doesn't record the change.
This patch appears to solve it for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | role_expire-707042-01.patch | 635 bytes | kentr |
Comments
Comment #1
kentr commentedComment #2
kirie commentedI manually applied the patch to 6.x-1.9 and that did the trick for me. Note, though, that the 'User' cell in the Role History table shows empty - but that is a issue with Role Watchdog I assume?
Comment #3
stewsnoozeA manual edit of the patch just because I had added comments in to the code that stopped it applying quickly has been committed to CVS HEAD. It will be in the next release. THANKS!!!!
Comment #4
sharplesa commentedShould be fixed by patch at http://drupal.org/node/1302440#comment-5100190 (which incorporate's kentr's work).
Comment #5
sharplesa commentedAddressed by role_expire 6.x-1.11, posted today (2011-10-30).