Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2016 05:35:42 AM (3 years ago)
Author:
boonebgorges
Message:

Groups: Remove 'populate_extras' flag from BP_Groups_Group.

populate_extras was originally designed to reduce the number of
additional queries performed when setting up a group, by making those
queries optional in cases where the additional data was not needed.
Now, all of these properties are adequately cached, and lazy-loaded
so that they're only fetched when requested.

See #5451.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/groups/functions.php

    r9819 r11089  
    614614
    615615    /**
    616      * @group groups_get_group
    617      * @group cache
    618      */
    619     public function test_groups_get_group_cache_different_users() {
    620         $g = $this->factory->group->create();
    621         $u1 = $this->factory->user->create();
    622         $u2 = $this->factory->user->create();
    623         $this->add_user_to_group( $u1, $g );
    624 
    625         $old_user = get_current_user_id();
    626         $this->set_current_user( $u1 );
    627 
    628         $group1 = groups_get_group( array( 'group_id' => $g, 'populate_extras' => true ) );
    629 
    630         $this->set_current_user( $u2 );
    631 
    632         $group2 = groups_get_group( array( 'group_id' => $g, 'populate_extras' => true ) );
    633 
    634         $this->assertNotEquals( $group1, $group2 );
    635 
    636         $this->set_current_user( $old_user );
    637     }
    638 
    639     /**
    640616     * @group counts
    641617     */
Note: See TracChangeset for help on using the changeset viewer.