[buddypress-trac] [BuddyPress Trac] #8297: The function groups_get_invites_for_user() can return inconsistent total
buddypress-trac
noreply at wordpress.org
Tue May 12 11:24:11 UTC 2020
#8297: The function groups_get_invites_for_user() can return inconsistent total
--------------------------+----------------------
Reporter: imath | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Up Next
Component: Groups | Version:
Severity: normal | Resolution:
Keywords: dev-feedback |
--------------------------+----------------------
Description changed by imath:
Old description:
> Now that Group invites are managed using the BP Invitations API, it looks
> like the total of groups can be inconsistent into this function. I've
> found a case where there were no groups found and the total was 1. The
> reason was the {{{$wpdb . 'bp_invitations'}}} table was containing an
> invite for a group that has been deleted.
>
> Is there a reason why we don't use the total number of groups returned by
> the {{{groups_get_groups()}}} and used instead
> {{{groups_get_invite_count_for_user()}}} which run an extra DB query that
> can be wrong...
>
> See https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups/bp-
> groups-functions.php#L1420
New description:
Now that Group invites are managed using the BP Invitations API, it looks
like the total of groups can be inconsistent into this function. I've
found a case where there were no groups found and the total was 1. The
reason was the {{{$wpdb . 'bp_invitations'}}} table was containing an
invite for a group that has been deleted.
Is there a reason why we don't use the total number of groups returned by
the {{{groups_get_groups()}}} and use instead
{{{groups_get_invite_count_for_user()}}} which run an extra DB query that
can be wrong...
See https://buddypress.trac.wordpress.org/browser/trunk/src/bp-groups/bp-
groups-functions.php#L1420
--
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8297#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list