Hi all,

I'm using Rules to:

  1. assign a "special role" to a user when "User membership has been approved" -> Ok, no problem, works correctly
  2. remove the same "special role" from user when "User has been removed from group" -> BUG triggered

BUG explanation for point 2:

  1. A group admin try to remove "user A" from his group in "/group/node/XXX/admin/people"
  2. "User A" is NOT REMOVED from group, but...
  3. The "special role" is correctly removed from "user A"

What's wrong?

Thank you

Comments

CarolineCB’s picture

Version: 7.x-2.x-dev » 7.x-2.2

I have the exact same problem. Did you ever find a way to correct it? I even tried adding "Unsubcribe user from group" and "Remove entity from group" after I saved the user but it doesn't work. Is there a way to remove a user from a group programatically? I've found og_group() to add them but none to remove them.

CarolineCB’s picture

I found it!

After saving the user without the new group, I added the line:
og_ungroup('node', $og_membership->gid, 'user', $account);
And now the user was removed from the group.