[buddypress-trac] [BuddyPress Trac] #7078: Groups: Replace `BP_Group_Member` static method DB queries with updated group membership functions

buddypress-trac noreply at wordpress.org
Sat May 28 13:25:31 UTC 2016


#7078: Groups: Replace `BP_Group_Member` static method DB queries with updated
group membership functions
-------------------------+-------------------------------------------------
 Reporter:  r-a-y        |       Owner:  boonebgorgesWhat's the clever way
     Type:  enhancement  |  to have all of these pieces work together
 Priority:  normal       |  without repeating logic?
Component:  Component -  |      Status:  assigned
  Groups                 |   Milestone:  2.6
 Severity:  normal       |     Version:
 Keywords:  has-patch    |  Resolution:
-------------------------+-------------------------------------------------
Changes (by boonebgorges):

 * owner:   =>
     boonebgorgesWhat's the clever way to have all of these pieces work
     together without repeating logic?
 * status:  new => assigned


Comment:

 Cool, let's definitely do something like this.

 The changes to `groups_check_user_has_invite()` and
 `groups_check_for_membership_request()` look good to me.

 It feels funny to replace the guts of a database query method like this.
 While I'm a fan of the new caching strategy here (obviously!) there may
 still be legitimate use cases where one wants to fetch hot membership data
 right from the db - `SELECT id FROM wp_bp_groups_members ...`. My
 inclination would be to swap out all calls to
 `BP_Groups_Member::check_is_invite()` with `groups_is_user_member()` etc.
 Then the database query method will no longer be used by BP core, but will
 stay unchanged for anyone referencing it.

 A bonus of this is that we get rid of some direct calls to the
 `BP_Groups_Member` methods; generally we like to standardize on the
 procedural wrappers, for better filter support, etc. I think this would
 also cover @dcavins's concern about "repeating logic" - or at least it'd
 make us more internally consistent.

 This is mostly a gut feeling, and I don't feel strong about it, so if
 @r-a-y and @dcavins both think that [attachment:7078.01.patch] is better,
 then go for it.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7078#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list