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.
We recently upgrade to the the latest rel of og: 7.x-2.9. Since doing this, now when we add new users and assign them to a group; they are in state Pending. Before, they used to be immediately Active.
To be clear, the way we add new members is we have an og_user_node field on the User entity. When we add a new user we simply select which Group the user belongs to with that field.
I have looked through every OG admin page i can find and i see nothing regarding the default membership state.
Comment | File | Size | Author |
---|---|---|---|
#20 | og_default_state_pending_2744405_11650415-20.patch | 974 bytes | ShaunDychko |
#17 | og_default_state_pending_2744405_11650415.patch | 1.19 KB | mmcintosh |
Comments
Comment #2
ultimikeI'm seeing the same behavior...
-mike
Comment #3
potassiumchloride CreditAttribution: potassiumchloride commentedSame here. Is there a place where the default membership state can be set to "Active"?
Comment #4
amitaibuIt might be related to this change.
1. Is the group the user is added to defined as skip approval?
2. When adding the user via OG's "add people" page, does it work properly?
Comment #5
potassiumchloride CreditAttribution: potassiumchloride commented1. Is the group the user is added to defined as skip approval?
Where is this setting? I don't see it at admin/config/group/settings or admin/config/group/permissions/node/group. And Googling various combinations of things didn't get me any closer to finding where this could be hiding from me in OG.
2. When adding the user via OG's "add people" page, does it work properly?
Yes. Just tested both ways. Added a user via Add People and the user was Active immediately. Removed user Visited the user's page, added to the group, went back to the group and the person was there as Pending.
Comment #6
amitaibuWhere is this setting?
This is the permissions for the group level. Depends on how you defined it, but most probably under
admin/config/group/permissions
Comment #7
potassiumchloride CreditAttribution: potassiumchloride commentedAh-ha. Thanks.
For others - to allow users to be added to a group from their user profile page (by a site admin) AND for their membership to be set to Active and not Pending, you still need the group's permissions to be set to "no approval required."
In the permissions matrix under admin/config/group/permissions, look for:
Organic Groups UI
Subscribe to group (no approval required)
Allow non-members to join a group without an approval from group administrators.
Check the box for "non-member" for this row.
If you only want members to be added by site admins, though, and not by users from their own user profile pages, you will need to check other permissions to confirm that the user doesn't see the group list on his/her profile page.
Comment #8
rv0 CreditAttribution: rv0 at Coworks.be commentedusing the solution from above, described in full in #7, any site member can just join any group via group/node/*/subscribe
A serious security risk on our sites if we enable that, as anyone can create an account.
the previous behavior was that when an admin user adds a user to a group (from that users profile), it was approved right away. I see no use in placing the group member in a pending membership when the acting user is a group admin.
What changed and how can we revert to the old behavior?
For us, this regression is a major issue.
Comment #9
potassiumchloride CreditAttribution: potassiumchloride commentedI tested what is described in #8 because we also allow users to create accounts. Drupal user accounts must be approved by a site admin, though, so that might be a little different.
Here's what I did: I pretended I was a new user and created an account. As a site admin, I went in and approved the account but didn't add the user to any groups. I logged in as the new user and tried to subscribe to an account at group/node/*/subscribe. The "join" option was there and I clicked successfully. However, when I went to the group's page, it was inaccessible (Access Denied), even after logging in and out. So, the group subscription was not successful from the new user's standpoint. As a site admin, I looked at list of group members and there was the new user but still Pending.
So, it seems the fix in #7 is working for us. However, this is odd given that we have the "subscribe to group (no approval required) permission checked now and it shouldn't work this way! Something is screwy with OG permissions.
Comment #10
vensires CreditAttribution: vensires commentedSame issue here as described above. I hadn't even noticed there was a Pending state before this error.
Comment #11
rv0 CreditAttribution: rv0 at Coworks.be commentedbump.
Comment #12
rv0 CreditAttribution: rv0 at Coworks.be commentedAs this is a regression / change from previous versions, this might be better categorized as a bug report?
Comment #13
rv0 CreditAttribution: rv0 at Coworks.be commentedMeanwhile, we fixed this using a simple rule to auto approve, works fine for our case and we don't have to open up any more permissions as described in #7.
However, be careful using this on a site where anyone can apply for group membership, as those memberships would be approved right away.
Comment #14
chris_h CreditAttribution: chris_h commentedWe've applied a fix in https://github.com/Gizra/og/pull/124 but it hasn't been merged as yet.
Comment #15
AnybodyI can confirm the problem still exists and I think it's really problematic for many sites.
So I'd suggest to introduce a new setting where to set the default state after setting a users group. This would be the most flexible solution I think.
Comment #16
mmcintosh CreditAttribution: mmcintosh commentedI tested the code from Gizra's github and left a comment there as well that this worked for me.
https://github.com/Gizra/og/pull/124
I tested this code on OG 7.2.9 where I had the same issue as described in this issue:
https://www.drupal.org/node/2744405
I found the code work as expected and now an administrator can add a user to a group and have it be active instead of pending. This was the behavior that was previously in place.
Comment #17
mmcintosh CreditAttribution: mmcintosh commentedI created a patch against eh 7.x-2.x dev version that works for me on the present 7.x-2.9 version as well in the hopes it helps someone else. All the thanks to chris_h for the code.
Comment #18
AnybodyThank you very much. The patch works good for me. Further feedback for RTBC?
Comment #19
vensires CreditAttribution: vensires commented@mmcintosh I suggest removing the old line of code which is commented out in your patch. Other than that I have also tested this and it really is RTBC.
Comment #20
ShaunDychko CreditAttribution: ShaunDychko for Bellin commentedRerolled #17 to remove the commented code.
Comment #22
amitaibuThanks. The tests seem to fail. Would be great also to have a simpleTest to prevent regression.
Comment #23
amitaibuActually, sorry - closed in favor of the GitHub PR
https://github.com/Gizra/og/pull/124#issuecomment-254349342
Comment #24
liquidcms CreditAttribution: liquidcms commentedhmm.. since when do we track issues for Drupal projects on github.. :(
Comment #25
rclemings CreditAttribution: rclemings as a volunteer commentedI don't see this commit in og 7.x-2.10. Has it been fixed elsewhere now or was it just omitted?
Comment #26
jackalope CreditAttribution: jackalope commentedI ran into the same question myself today while applying updates. This diff of the og-7.x-2.9 file in question against the 7.x-2.10 version seems to indicate that this commit/patch is no longer needed because the code affected by the patch is completely gone:
(cross-posting to https://github.com/Gizra/og/pull/124#issuecomment-404972537)
Comment #27
rclemings CreditAttribution: rclemings as a volunteer commented@jackalope: I think you're right. It's been a month now and I'm seeing no problems.