When a group is set to "Moderated - membership requests must be approved.", OGUR adds assigned roles to unapproved members.

The attached patch fixes this in og_user_roles_grant_roles() by JOINing the og_uid table and checking if is_active is set to 1.

CommentFileSizeAuthor
ogur_is_active.patch1.04 KBMrHaroldA
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pdrake’s picture

Status: Active » Reviewed & tested by the community

This patch worked for me - thanks.

sun’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/sites/all/modules/og_user_roles/og_user_roles.module	Mon Mar 28 10:51:18 2011 +0200
@@ -356,7 +356,14 @@
+      JOIN {og_uid} ogu ON ogu.nid = ogur.gid AND ogu.uid = ogur.uid

Shouldn't this be an INNER JOIN then?

MrHaroldA’s picture

@sun: good question.

The idea was to give unapproved members no OGUR roles at all. The WHERE clause filters the inactive user anyway, so I guess it could be a LEFT JOIN too.

Haven't used OG in a while, so I can't test both queries atm...