[buddypress-trac] [BuddyPress Trac] #7397: groups_send_invites() should allow us to omit sending to users that have already received an invite

buddypress-trac noreply at wordpress.org
Tue Dec 20 16:24:04 UTC 2016


#7397: groups_send_invites() should allow us to omit sending to users that have
already received an invite
-------------------------+------------------------------
 Reporter:  r-a-y        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Groups       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Old description:

> `groups_send_invites()` is the function that handles sending group
> invites.
>
> In that function, there is a call to `groups_get_invites_for_group()`.
> This function determines what users to send an invite to.
>
> However, `groups_get_invites_for_group()` doesn't allow us to check if we
> have already sent an invite to that user due to a lack of check for
> `invite_sent = 1`.
>
> Attached patch allows for this and includes unit tests.
>
> Note: I have not changed the default logic of `groups_send_invites()` to
> omit sending to those we have already sent invites to.  However, we can
> if we want to.

New description:

 {{{#!php
 <?php

 }}}
 `groups_send_invites()` is the function that handles sending group
 invites.

 In that function, there is a call to `groups_get_invites_for_group()`.
 This function determines what users to send an invite to.

 However, `groups_get_invites_for_group()` doesn't allow us to check if we
 have already sent an invite to that user due to a lack of check for
 `invite_sent = 1`.

 Attached patch allows for this and includes unit tests.

 Note: I have not changed the default logic of `groups_send_invites()` to
 omit sending to those we have already sent invites to.  However, we can if
 we want to.

--

Comment (by boonebgorges):

 > What do you think about using your continue approach? And also taking
 parts of the groups_get_invites_for_group() and
 BP_Groups_Group::get_invites() mods from 01.patch?

 Sure, that seems reasonable. The changes from 01.patch wouldn't be used in
 this specific fix, but they could definitely be useful for developers down
 the road.

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


More information about the buddypress-trac mailing list