There appears to be a workflow bug that's come about as of the recent version of OG that's seeking to prevent users from self-subscribing to things via their profile form.

http://cgit.drupalcode.org/og/commit/?id=905ebc0

This passes in and ensures that user entity saves are being set to pending unless they already have permission to subscribe without an additional permission verification. What this doesn't account for is an admin user going to the user profile and adding them to a group and saving the user entity. What happens then is that the user is set to pending even though the admin has the ability to grant them the full membership. Adding to the confusion, if you go to the group and subscribe them there they'll instantly be given access.

I'm not sure the best approach for fixing this other then possibly to document that it's the case that users won't be full group members if admins add them via the user's profile. Possibly an additional check could be done to see if the user currently executing the operation HAS the ability to subscribe without approval as opposed to the entity currently being worked on (which in the case of a non-admin user account being saved, this account doesn't have this ability).

  if (empty($item['state']) && $entity_type == 'user' && !og_user_access($group_type, $gid, 'subscribe without approval', $entity)) {
    $item['state'] = OG_STATE_PENDING;
  }

Would have to become something like

  if (empty($item['state']) && $entity_type == 'user' && !og_user_access($group_type, $gid, 'subscribe without approval', $entity) && !og_user_access($group_type, $gid, 'subscribe without approval', $GLOBALS['user'])) {
    $item['state'] = OG_STATE_PENDING;
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

btopro created an issue. See original summary.

btopro’s picture

this appears to fix the workflow issue from internal testing. I'll make a patch now

btopro’s picture

Status: Active » Needs review
FileSize
1002 bytes

Status: Needs review » Needs work

The last submitted patch, 3: og-admin-assign-member-2778559-3.patch, failed testing.