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.
When removing a user, the system currently iterates over og_role_revoke() causing a hit to the database for each role to be removed - this is not optimal.
Comment | File | Size | Author |
---|---|---|---|
#1 | og_role_revoke_all_1846008.patch | 711 bytes | dbehrman |
Comments
Comment #1
dbehrman CreditAttribution: dbehrman commentedThis is an added function to optimize all role removal in a single database call. It is not implemented in og.module, so it will only be used if called explicitly.
Comment #2
rv0 CreditAttribution: rv0 commentedI like the idea of grouping this functionality in one function.
Currently we are syncing users and groups/roles to LDAP. Every time a user logs in in it gets synced by adding memberships and removing memberships where needed.
For roles we remove all of them and then re-add them as needed.
Comment #3
amitaibucorrect status.
Comment #4
rv0 CreditAttribution: rv0 commented- does not adhere to OG 7.x-2.x api (does not have a $group_type function argument)
- is missing rules integration from og_role_revoke
Also, it may be a better solution to re-use og_role_revoke, or adjust it so that it can take both a $rid or an array of $rids as argument.
Less code duplication.