Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ipokkel opened this issue Oct 9, 2019 · 4 comments

Comments

@ipokkel
Copy link
Member

ipokkel commented Oct 9, 2019

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)

@zagarskas
Copy link

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.

@TheSashX
Copy link

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

@ipokkel
Copy link
Member Author

ipokkel commented May 22, 2020

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

@andrewlimaza andrewlimaza added this to the V1.3 milestone Jun 28, 2022
@andrewlimaza
Copy link
Collaborator

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 andrewlimaza removed this from the V1.3 milestone Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants