Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#5072 closed defect (bug) (fixed)

BP_Group_Member_Query assumes all members confirmed

Reported by: mike_cowobo's profile Mike_Cowobo Owned by: boonebgorges's profile 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 12 years ago.

Download all attachments as: .zip

Change History (5)

#1 @r-a-y
12 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
12 years ago

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

#3 @boonebgorges
12 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
10 years ago

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