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.
So at first I wasn't sure, but now I'm certain that members on my site are being removed from their groups in what appears to be a completely random occurrence. I'm the only one able to view the site right now, so it's not other folks messing around with their membership.
No errors are being thrown or logged, so I can't say what is causing this or offer much more than my observation.
Has anyone else had this problem?
Comments
Comment #1
bryancasler CreditAttribution: bryancasler commentedWell I just figured out that if a users url addy changes, this will remove them from all their groups.
Comment #2
amitaibu> users url addy changes
?
Comment #3
bryancasler CreditAttribution: bryancasler commentedI am using clean url's and a token from a user profile field to create the user's profile URL.
It looks something like this www.mywebsite.com/[token1]/user1
When a user changes their token, it changes their profile URL, and it also removes them from their groups.
Comment #4
Taxoman CreditAttribution: Taxoman commented(Subscribing, not confirming)
Comment #5
bryancasler CreditAttribution: bryancasler commentedThis may be related to this issue #1203466: Can't use og_group() when group-audience field cardinality is set to 1
I'm not sure how it happened but the "Groups audience" field on /admin/config/people/accounts/fields had it's value switched from unlimited back to 1.
I've just changed it back to unlimited and we'll see what happens.
Comment #6
Taxoman CreditAttribution: Taxoman commentedok, what happened? ;-)
Comment #7
bryancasler CreditAttribution: bryancasler commentedIt fixed it.
Comment #8
Taxoman CreditAttribution: Taxoman commentedComment #9
bryancasler CreditAttribution: bryancasler commentedre-opening this as it's cropping up again or I never actually got it fixed. The good news is that I can reproduce the problem.
The bug is simple, users can only join one group at any given time. Meaning if they go and join a second group, then they'll be removed from the first. No errors are thrown and the changes happen instantly.
I've used OG on other sites and have not experienced this issue. The website that is having the problem was migrated from a D6 install with OG. So it's possible that something went wrong during the migration and this is how it's manifesting.
Also I'm guessing that this is somehow related #1203466: Can't use og_group() when group-audience field cardinality is set to 1
Comment #10
bryancasler CreditAttribution: bryancasler commentedSo I've been looking in the DB to see what's going on and here is a step by step breakdown....
In the og_membership table I have a user (ID 1712) who has a user record for two groups (GID 46 and 25).
Screenshot: http://www.diigo.com/item/image/1ks4o/1q5k
I go to these groups and look at their membership, this user is listed on both...
GID 46 http://www.diigo.com/item/image/1ks4o/r4by
GID 25 http://www.diigo.com/item/image/1ks4o/gwbm
So that's good news! This user is a member of two groups. Lets try to add them to a third (GID 5)
They were successfully added! http://www.diigo.com/item/image/1ks4o/8o3d
But now when we look back at the og_membership table, we see that they are only a member of (GID 46 and 5).
Screenshot: http://www.diigo.com/item/image/1ks4o/we32
And to confirm, when we refresh the GID 25 members page, they are no longer listed.
Comment #11
bryancasler CreditAttribution: bryancasler commentedMini update. I noticed that sometimes people don't get removed from groups they are listed as an "administrator member" of, but that doesn't hold true all of the time... hmmm.
Comment #12
bruitism CreditAttribution: bruitism commentedOk I can confirm this is happening to my as well (all the same symptoms) + also this is a d6 site that has been upgraded to d7.
Only strange thing here is: this did use to work but not anymore. And strangely enough I'm still using og 7-1.3 that has been running smoothly before ...
Sorry I can't supply more helpful information just wanted that I'm affected as well.
Comment #13
bryancasler CreditAttribution: bryancasler commented@Amitaibu @Taxoman Any ideas about where I could continue looking to resolve this? I've really maxed out the limits of my current knowledge.
Comment #14
bryancasler CreditAttribution: bryancasler commentedHey everyone, I talked with my boss man we're putting out a bounty for this. Amitaibu suggested I post it in the issue que, so here it is! If anyone can help us resolve this issue, the $300 US is yours.
Comment #16
amitnarang28 CreditAttribution: amitnarang28 commentedThere are few other scenarios when I have noticed that groups are getting lost.
When any module is trying to save user profile, the same issue is happening for random users, these are the two scenarios which I have tried.
1. I tried to save the user profile from drupal edit screen and changed my image, one of my group was lost.
2. I tried to use ldap module for provisioning users/update users, when I logout and login back the user profile get's saved and one or the other group will be lost. This normally happens if you have more than one group i.e. 2nd or 3rd group is getting lost.
I am suspecting it somewhat the issue is lying behind the way user profile is getting save and the way we are having OG membership being saved back for user.
Hope it might help in finding more details.
Amit
Comment #17
Taxoman CreditAttribution: Taxoman commentedFor the record, is this a 1.x-only problem, or also happens "occasionally" in 2.x?
Comment #18
frank.schram CreditAttribution: frank.schram commentedI am getting this too in 7.x-1.5
Comment #19
frank.schram CreditAttribution: frank.schram commentedI had a rule running that changed the membership state to pending when a new user becomes a group member.
This caused this problem for me. After disabling the rule, a user can become a member of multiple groups again now.
So I will have to find an alternative for this rule to get the membership state to pending when a user subscribes to a group.
Comment #20
bryancasler CreditAttribution: bryancasler commentedOur site is using OG 7.x-1.4, can't speak to the other versions.
Comment #21
therainmakor CreditAttribution: therainmakor commentedIs anyone on this issue using the entitycache module? I am using the 7.x-2.x version of OG and the entitycache module was not refreshing the user entity, so whenever the user was loaded then the user's groups were not loaded along with it, so when the user entity was saved the next time the user lost some of its groups.
This behavior only seemed to occur when a user was added to a group from the group's group->add people tab. When a user was added to a group from the user edit page the user entity's cached version from the entitycache module was reset and thus the group was loaded the next time the user entity was loaded.
I disabled the entitycache module and this behavior stopped and a user's groups have not been lost yet. Please let me know if this helps anyone here.
Comment #22
bryancasler CreditAttribution: bryancasler commentedOur site still suffers from this problem, and we do run the Entity Cache module. I'm going to disable it and do some testing. Will report back.
Comment #23
therainmakor CreditAttribution: therainmakor commentedHas had any success resolving this by disabling the entity cache module?
Comment #24
bryancasler CreditAttribution: bryancasler commentedPeople are still getting removed from a group when they're added to another.
Comment #25
cgmonroe CreditAttribution: cgmonroe commentedIf you are using the Entity Cache module, this problem might be related to:
#1981406: Field cache isn't cleared after saving an OG membership
If not, it might give you some ideas where to look.
Comment #26
bryancasler CreditAttribution: bryancasler commentedThanks cgmonroe, will be tracking any progress there.
Comment #27
bryancasler CreditAttribution: bryancasler commentedRemoving the bounty.
Comment #27.0
bryancasler CreditAttribution: bryancasler commentedcorrection
Comment #28
Myna91 CreditAttribution: Myna91 commented@bryancasler
Hi,
Did you found any solution for this above issue, nnow we are also facing the same thing. please suggest me the solution you have used.
Thanks in advance.
Comment #29
Myna91 CreditAttribution: Myna91 commented