First, when I check/select the test user and submit 'Approve membership of selected users', There is a WSOD. In another thread to this group, I show the problem - http://drupal.org/node/1102522 - an extra argument sent to og_group. Putting in my fix for that, allows submittal and the return message shows success, but the user still has a status of 'Pending' because of the following bug.

When submitting an 'approve' option for a group member state, the correct, existing state value is not used. Debugging the code gives the following information:
When the code progresses to the og_group function, a $wrapper variable is set (in og.module, around line 1490 -- I have some dd() calls mixed in...). This gives me the correct value for the group member state, e.g.

og_group - $wrapper: Array
(
    [0] => Array
        (
            [gid] => 7
            [state] => 2
            [created] => 1300884090
        )

)

So, the correct state is 2 or OG_STATE_PENDING which is what exists in the DB record. When we get further down in the og_group function, there is a call to og_get_group_membership. This returns $group_membership information, but the state is always set to 1 or OG_STATE_ACTIVE. Following this through to the construction of the EntityOgMembership object shows that no array of values (the first arg to the constructor) is being sent, so the default values in the constructor are used. In there, state is always going to be OG_STATE_ACTIVE.

I would think the test in og_group that determines if a save is necessary where there currently is:

if ($group_membership->state != $state || $group_membership->name != $values['membership type']) {

would be better to compare against the previous variable $wrapper, so we would have something like:

if ($wrapper[0]['state'] == $state || $group_membership->name != $values['membership type']) {

What do you think? Otherwise I don't see how it can succeed when trying to approve a pending user.

Comments

amitaibu’s picture

Version: master » 7.x-1.x-dev

This should be fixed after I merge the og-migrate branch into -dev

cartagena’s picture

I am so sorry to report that I installed the most recent dev version dated Mar 23 and "approve membership of pending users" no longer gives me the WSOD but it doesn't approve the member. The green message says it approved but it still says pending. It does, however, work to remove a member. And the final time I tried was on a clean install. I wish I could be more helpful. Thank you very much. I've been working on this for the past 12 hours and know I can't do more without help. I'll keep watching for an update.

amitaibu’s picture

Status: Active » Postponed (maintainer needs more info)

Please get latest version, enable og-migrate and execute it's plugins, disable module and re-try.

cartagena’s picture

Thank you very much! My site goes live next week and I"ve posted that online groups will start in May so that gives me a couple weeks to get it set up. I am very grateful for all the work that has gone into this and anxious to get groups going. Thanks again!

amitaibu’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.