Opened 10 years ago
Closed 9 years ago
#6450 closed defect (bug) (no action required)
Weird behalf on group creation
Reported by: | danbp | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.3 |
Component: | Groups | Keywords: | reporter-feedback |
Cc: | slaffik |
Description
I found a weird behalf during group creation on frontend. It's not really a bug, but simply "strange" and using a custom function.
I just want want to let you know what happens.
The function in bp-custom: (found on a old forum topic)
function my_filter_group_status( $status ) { if( $key = array_search( 'hidden', $status ) ) { unset( $status[$key] ); } return $status; } add_filter( 'groups_allowed_status', 'my_filter_group_status' );
Has no utility, doesn't work, i simply forget to remove it.
Now with that function active, log in as user and create a new public group and go over to step 3 or 4, then go back to your groups directory.
The group exist, but has 2 members and both are group admins ! I made several tessts with different users. The second member is not always a friend of the user, and is apparently randomly added.
Remove the bad function and create a new group again. Anything is correct: group is created with only one member, the group admin.
Change History (7)
#4
@
9 years ago
Sorry, i'm busy... Yes, i redo my test on a fresh install and found a culprit: BP Default Data plugin.
Group members table contains member with a user_tile of Administration and other have a user_title of Group Admin and other no title at all.
The origin of the issue is insertion of random users with "Administration" user_title... when a group is created - no matter which user is the creator.
I'm using that plugin since a while and it's possible that it stored some "old" or "custom" dats...
The oly reference to user_title is BPDD is
$new_member->user_title = '';
I'm sorry, but i wasn't able to reproduce. The filter you shared has only one impact: disallow the hidden status on group edit screens (WordPress backend or the group's manage screen).
On a non multisite config, i've tried with 3 users to create public, hidden, stop before the end of the create steps, finish all steps etc.. And everything works fine. The directory displayed the right count and no extra users are added as admins.
On a side note, i think we should work on improving how group status could be extended/restricted. It seems to me that this filter should also be used to list the available radio buttons in group create/manage screens... But i think there might be a ticket about it.
Can you try with a brand new WordPress install to see if you manage to reproduce ?