pmpro-buddypress icon indicating copy to clipboard operation
pmpro-buddypress copied to clipboard

Bug: The” BuddyPress Add On” overrides query_vars and then shows ALL members no matter what search is typed in.

Open ipokkel opened this issue 5 years ago • 4 comments

User reported the following:

Issue 1- The” BuddyPress Add On” overrides query_vars and then shows ALL members no matter what search is typed in.

Issue 2- Setting “Lockdown BuddyPress?” to NO stops ALL members from showing “Include in Member Directory” should be ignored if lock-down is set to NO

========== to recreate problem ========= Install plugins: Buddypress Paid Memberships Pro Paid Memberships Pro – BuddyPress Add On BP Profile Search (see plugin list for URLs)

Add in some custom fields https://codex.buddypress.org/administrator-guide/extended-profiles/

Create a search form using BP Profile Search

The search results page will show ALL members instead of only the “found members”

Traced the problem to here: /pmpro-buddypress-master/includes/directory.php

– THIS – function pmpro_bp_bp_pre_user_query_construct() – USES – $query_array->query_vars[‘include’] – FORCING – an array of ALL members into the include list It should instead honor any search filters, especially those done by “BP Profile Search”

Because of this any “search queries” are nullified and the search system misbehaves.

Moderators only: https://www.paidmembershipspro.com/forums/topic/bug-report-the-buddypress-add-on-overrides-query_vars-shows-all-members/ (includes video)

ipokkel avatar Oct 09 '19 12:10 ipokkel

I feel like the original video is a key part of this bug report https://www.screencast.com/t/t0xHRqvH

I've played with a couple solutions that range from commenting out $query_array->query_vars[‘include’] to merging it back into the query.

zagarskas avatar Oct 09 '19 19:10 zagarskas

i have the same problem. is there a fix??

TheSashX avatar Oct 15 '19 19:10 TheSashX

Here's a possible workaround that should work with the with the latest versions of BuddyPress v6.0.0, PMPro v2.3.3, and the PMPro BuddyPress Integration v1.2.5. Please be aware this is not a thoroughly tested recipe and is therefore considered as a “use-at-own-risk” option.

https://gist.github.com/ipokkel/bd2ec77bc2104793fd699d3792d34345

ipokkel avatar May 22 '20 14:05 ipokkel

For now, I recommend using the gist @ipokkel provided. The BPS Search plugin is taking over the search query. We need a bit more thought around a solution here.

andrewlimaza avatar Jul 21 '22 09:07 andrewlimaza