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.
I just realized, that the static cache of og_get_user_roles() function should be resetted before other modules may react on this actions via hook_og_role_revoke(). This is already done for hook_og_role_grant() (see og_role_grant() -> there is a og_invalidate_cache() call before the hook calls).
This is especially important for Rules conditions, because you cannot check OG roles in a rule that reacted on the "OG role revoked from user" event, because the revoked role is still stuck in the static cache.
Comment | File | Size | Author |
---|---|---|---|
#1 | invalidate-cache-on-role-revoke.patch | 413 bytes | hctom |
Comments
Comment #1
hctomComment #2
hctomComment #3
hctomJust a little workaround for everybody else experienceing this issue:
Just put the following hook in one of your modules
Comment #4
amitaibuCommitted, thanks.
Comment #6
hctomYou're welcome ;)