Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5416 closed enhancement (fixed)

Suggestion for the get_group_extras function - Save two db queries for non logged-in viewers.

Reported by: lenasterg's profile lenasterg Owned by: boonebgorges's profile boonebgorges
Milestone: 2.0 Priority: normal
Severity: normal Version:
Component: Groups Keywords:
Cc:

Description

The get_group_extras() in groups-classes.php actually check the paged groups in relation to logged-in user.
So, for non login users it could save 2 db queries if there was a check if a user is logged in or not.

Attachments (1)

bp-groups-classes.php.patch (477 bytes) - added by lenasterg 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
11 years ago

In 7938:

Add tests for BP_Groups_Group::get_group_extras()

See #5416

#2 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 2.0

Good find. We can't just bail out of the function as you've suggested (we still have to set the is_invited etc keys) but you're right that we should be able to avoid the queries.

#3 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7939:

Don't query for group extras if user is not logged in

Saves a couple needless database queries for unauthenticated users.

Fixes #5416

Props lenasterg for initial patch

Note: See TracTickets for help on using tickets.