Check the value of the “bp-xprofile-fullname-field-name” entry in the WordPress “wp_options”-table.
SELECT * FROM wp_options WHERE option_name LIKE 'bp-xprofile-fullname-field-name'
Its value should match the name of the profile field containing the Member-Name. Usually the same as whats returned by
SELECT name FROM wp_bp_xprofile_fields WHERE id = 1
If the value in bp-xprofile-fullname-field-name is invalid (for example: in my case it contained “Name” but I renamed the first profile field to “Lastname, Firstname”), BuddyPress goes bonkers and tries to execute an invalid SQL-query resulting in an empty memberlist.
The main problem is the code located in “plugins\buddypress\bp-core\bp-core-classes.php” around line 260:
} else {
$fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) );
$this->uid_name = 'user_id';
$sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$bp->profile->table_name_data} u";
$sql['where'][] = "u.field_id = {$fullname_field_id}";
$sql['orderby'] = "ORDER BY u.value";
$sql['order'] = "ASC";
}
$fullname_field_id is empty if the value in bp-xprofile-fullname-field-name points to an non-existing fieldname.