Changeset 9985
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r9819 r9985 343 343 $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE %s", $search_terms_like ); 344 344 } else { 345 $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s '{$pag_sql}", $search_terms_like );345 $sql = $wpdb->prepare( "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s {$pag_sql}", $search_terms_like ); 346 346 $total_sql = $wpdb->prepare( "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE %s", $search_terms_like ); 347 347 } -
trunk/tests/phpunit/testcases/friends/class-bp-friends-friendship.php
r9819 r9985 12 12 xprofile_set_field_data( 1, $u2, 'Cool Dude' ); 13 13 xprofile_set_field_data( 1, $u3, 'Rock And Roll America Yeah' ); 14 15 friends_add_friend( $u1, $u2, true ); 16 friends_add_friend( $u1, $u3, true ); 17 18 $friends = BP_Friends_Friendship::search_friends( 'Coo', $u1 ); 19 $this->assertEquals( array( $u2 ), $friends['friends'] ); 20 } 21 22 /** 23 * @ticket BP6546 24 */ 25 public function test_search_friends_with_xprofile_inactive() { 26 $this->deactivate_component( 'xprofile' ); 27 28 $u1 = $this->factory->user->create(); 29 $u2 = $this->factory->user->create(); 30 $u3 = $this->factory->user->create(); 31 32 add_user_meta( $u2, 'nickname', 'Cool Dude' ); 33 add_user_meta( $u3, 'nickname', 'Rock And Roll America Yeah' ); 14 34 15 35 friends_add_friend( $u1, $u2, true );
Note: See TracChangeset
for help on using the changeset viewer.