[buddypress-trac] [BuddyPress Trac] #5711: BP_Groups_Member::get_group_administrator_ids() not cached
buddypress-trac
noreply at wordpress.org
Sun Jun 15 22:21:25 UTC 2014
#5711: BP_Groups_Member::get_group_administrator_ids() not cached
-------------------------+-----------------------
Reporter: r-a-y | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.1
Component: Groups | Version:
Severity: normal | Keywords: has-patch
-------------------------+-----------------------
In the group loop, when the "Leave Group" button is in the process of
rendering, `groups_get_group_admins()` is called.
`groups_get_group_admins()` therein calls
`BP_Groups_Member::get_group_administrator_ids()`. This DB query is
uncached.
If the logged-in user is viewing the group directory and is a member of
each group in the loop, this can lead to 20 additional DB queries being
run.
Attached patch caches calls to
`BP_Groups_Member::get_group_administrator_ids()` and invalidates the
cache whenever a group member is promoted or demoted and when a group is
deleted. Let me know if more unit tests are required.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5711>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list