Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/23/2015 01:39:05 AM (10 years ago)
Author:
boonebgorges
Message:

Use 'bp_member_member_type' as the member type cache bucket name.

Using 'bp_member_type' was creating the potential for collisions between WP's
taxonomy cache (which uses the taxonomy name 'bp_member_type' and term IDs as
cache keys) and BP's per-member member type cache (which uses the bucket
'bp_member_type' and user IDs as cache keys). The collisions take place only
when there is a 'bp_member_type' term ID that overlaps with a user ID.

The new cache group 'bp_member_member_type' is chosen to underscore that what's
being cached is the relationship between individual members and the user types
to which they belong.

Props imath, johnjamesjacoby.
Fixes #6242.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/class-bp-user-query.php

    r9447 r9533  
    515515        ) );
    516516
    517         $this->assertSame( array( 'foo' ), wp_cache_get( $users[0], 'bp_member_type' ) );
    518         $this->assertSame( array( 'bar' ), wp_cache_get( $users[1], 'bp_member_type' ) );
    519         $this->assertSame( array( 'foo' ), wp_cache_get( $users[2], 'bp_member_type' ) );
    520         $this->assertSame( '', wp_cache_get( $users[3], 'bp_member_type' ) );
     517        $this->assertSame( array( 'foo' ), wp_cache_get( $users[0], 'bp_member_member_type' ) );
     518        $this->assertSame( array( 'bar' ), wp_cache_get( $users[1], 'bp_member_member_type' ) );
     519        $this->assertSame( array( 'foo' ), wp_cache_get( $users[2], 'bp_member_member_type' ) );
     520        $this->assertSame( '', wp_cache_get( $users[3], 'bp_member_member_type' ) );
    521521    }
    522522}
Note: See TracChangeset for help on using the changeset viewer.