[buddypress-trac] [BuddyPress Trac] #6597: Targeting the 'groups_leave_group' action can be difficult

buddypress-trac noreply at wordpress.org
Mon Aug 24 19:59:18 UTC 2015


#6597: Targeting the 'groups_leave_group' action can be difficult
------------------------------------+------------------------------
 Reporter:  thebrandonallen         |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Component - Groups      |     Version:  2.3.0
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+------------------------------

Comment (by r-a-y):

 The real problem is wanting to stick to our wrapper functions where they
 sound correct to use, but end up creating problems.

 The more I'm thinking about it, the more I like your initial solution,
 thebrandonallen:

 > The easiest solution would be to replace the `groups_remove_member()`
 call with a call to `BP_Groups_Member::remove()`. The problem with that is
 that we then have two nearly identical functions.

 However, `BP_Groups_Member::remove()` is too lenient, which is probably
 why `groups_uninvite_user()` was used in the first place because it has
 more checks on `is_confirmed` and `inviter_id` before removing the user
 from a group.

 Our patches in this ticket are both trying to work around the hook-firing
 issue, which to me sounds wrong.

 Ugly as it may sound, reverting r9811 might be the best course of action.

 Or perhaps we change the `groups_remove_member()` call to
 `BP_Groups_Member::remove_invite()`, as the static method will bypass
 another hook.

 @dcavins and others - Want to chime in?

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


More information about the buddypress-trac mailing list