Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#5072 closed defect (bug) (fixed)

BP_Group_Member_Query assumes all members confirmed

Reported by: Mike_Cowobo Owned by: boonebgorges
Milestone: 1.8 Priority: normal
Severity: normal Version: 1.8
Component: Groups Keywords: has-patch
Cc:

Description

BP_Group_Member_Query doesn't take confirmed / unconfirmed status into account, ie. unconfirmed (invited or membership-requesting) users are listed as members in the group member list.

I see two solutions:
1) Add is_confirmed to the query vars, default to true.
2) Add unconfirmed as a possible role (with member, mod, admin).

Option (2) is elegant as querying based on user role is what the class is all about, however, it will add more clutter to the code, because the is_{$role} syntax doesn't fly here. Besides, confirmed/unconfirmed is more of a status than a role.

Option (1) is appealing, because it entails hardly 2 lines of code and is quite clear. However, it makes it possible to make strange queries like role=admin&is_confirmed=0.

For something that will most likely be hardly ever be used in a non-default way, I would think option 1 is the most straight-forward solution. I have attached a patch that implements this.

Attachments (1)

5072.001.diff (1.1 KB) - added by Mike_Cowobo 6 years ago.

Download all attachments as: .zip

Change History (5)

@Mike_Cowobo
6 years ago

#1 @r-a-y
6 years ago

  • Milestone changed from Awaiting Review to 1.8
  • Version set to 1.8-beta

Thanks for the report, Mike_Cowobo.

You bring up good points regarding both options. I'll let Boone chime in here since he wrote the BP_Group_Member_Query class.

#2 @boonebgorges
6 years ago

Good catch, Mike_Cowobo. I agree that option 1 is best.

#3 @boonebgorges
6 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7237:

Adds is_confirmed param to BP_Group_Member_Query, defaulting to true

This additional parameter ensures that BP_Group_Member_Query distinguishes
between confirmed and unconfirmed members when pulling up lists of group
members.

Fixes #5072

Props Mike_Cowobo

#4 @johnjamesjacoby
4 years ago

  • Version changed from 1.8-beta to 1.8
Note: See TracTickets for help on using tickets.