Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5550 closed defect (bug) (fixed)

members loop query bug with the bp_use_legacy_user_query filter

Reported by: DJPaul Owned by: boonebgorges
Milestone: 2.0.1 Priority: high
Severity: normal Version: 2.0
Component: Members Keywords: needs-patch needs-unit-tests
Cc:

Description (last modified by DJPaul)

When the bp_use_legacy_user_query filter is used to switch BP to the pre-1.7 member loop query changes, and you pass the type=alphabetical argument to bp_has_members(), a bug introduced in r7700 (probably BP 1.9.1) causes members to appear many times in the members loop.

Change History (8)

#1 @DJPaul
6 years ago

Best way to recreate this is by adding the following to a mu-plugins helper, and then visiting the members directory:

<?php
add_filter( 'bp_use_legacy_user_query', '__return_true' );
add_filter( 'deprecated_function_trigger_error', '__return_false' );

add_filter( 'bp_ajax_querystring', function( $retval ) {
	return 'type=alphabetical';
}, 1000 );

#2 @DJPaul
6 years ago

  • Description modified (diff)

#3 @DJPaul
6 years ago

  • Keywords needs-patch needs-unit-tests added

#5 @boonebgorges
6 years ago

  • Milestone changed from Awaiting Review to 2.0.1
  • Version changed from 1.9.1 to 2.0

#6 @DJPaul
6 years ago

Just checked -- r7700 was introduced in trunk for 2.0, not 1.9.1. I misread the commits logs when chasing it down earlier. So it is a regression in 2.0.

#7 @boonebgorges
6 years ago

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

In 8289:

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

#8 @boonebgorges
6 years ago

In 8290:

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

Note: See TracTickets for help on using tickets.