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.
Currently it is not possible to act through rules when a OG role is granted or revoked from a user. It would be interesting to have rules events that can be triggered by those events and a small patch would allow that, but I couldn't find anything related in the issue queue.
Is that a feature that you would consider to include, if I submit a patch?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#12 | og-add_og_role_events-1816800-4.patch | 2.74 KB | othermachines |
#12 | interdiff.txt | 1.07 KB | othermachines |
#10 | og-add_og_role_events-1816800-3.patch | 2.77 KB | othermachines |
#10 | interdiff.txt | 1.37 KB | othermachines |
#8 | og-add_og_role_events-1816800-2.patch | 2.47 KB | othermachines |
Comments
Comment #1
hernani CreditAttribution: hernani commentedAnd patch attached!
Comment #2
hernani CreditAttribution: hernani commentedChanging status.
Comment #3
amitaibuI would expect the rule to pass the role as-well.
Comment #4
hernani CreditAttribution: hernani commentedWhat should be the variable type of the role?
Comment #5
maximpodorov CreditAttribution: maximpodorov commentedMaybe it's a separate issue...
Is it possible to add new actions which grant and revoke user role?
Something like this:
Comment #6
othermachines CreditAttribution: othermachines commentedI need this, so I've created a new patch against 7.x-2.x. It passes in the role id.
Comment #7
pippopeppe CreditAttribution: pippopeppe commented#6: og-add_og_role_events-1816800.patch queued for re-testing.
Comment #8
othermachines CreditAttribution: othermachines commentedRerolled without whitespace errors.
Comment #9
amitaibuWhy hardcode to node?
Comment #10
othermachines CreditAttribution: othermachines commentedYou know, that's a very good question. Again...
(Also fixed a small typo.)
Comment #11
amitaibuentity_metadata_wrapper() can get the $uid, no need to user_load() it.
Comment #12
othermachines CreditAttribution: othermachines commentedAgain...
Comment #13
amitaibuCommitted, thanks.