Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/17/2014 07:08:40 PM (12 years ago)
Author:
boonebgorges
Message:

Reintroduce DISTINCT keyword to BP_Core_User::get_users()

The lack of DISTINCT was causing duplicate entries when joining against the
xprofile fields for the purposes of alphabetical sorts.

Reverts part of r7700. See #5303

Fixes #5550

File:
1 edited

Legend:

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

    r7860 r8290  
    104104        }
    105105
     106        /**
     107         * @expectedDeprecated BP_Core_User::get_users
     108         * @group get_users
     109         * @group type
     110         */
     111        public function test_type_alphabetical() {
     112                $u1 = $this->create_user( array(
     113                        'display_name' => 'foo',
     114                ) );
     115                $u2 = $this->create_user( array(
     116                        'display_name' => 'bar',
     117                ) );
     118
     119                global $wpdb;
     120
     121                $q = BP_Core_User::get_users( 'alphabetical' );
     122                $found = array_map( 'intval', wp_list_pluck( $q['users'], 'id' ) );
     123
     124                $this->assertEquals( array( $u2, $u1 ), $found );
     125        }
     126
    106127        public function test_get_specific_users() {
    107128                $u1 = $this->create_user();
Note: See TracChangeset for help on using the changeset viewer.