#4563 closed defect (bug) (no action required)
BP template loops autopopulate the "user_id" parameter when on a user's page
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 1.2 |
| Component: | Core | Keywords: | reporter-feedback |
| Cc: |
Description
If you use a custom BP loop (like a members loop or an activity loop) on a displayed user's page, BP will try to be "smart" by automatically filling in the user_id parameter to use the displayed user's ID.
eg.
https://buddypress.trac.wordpress.org/browser/trunk/bp-activity/bp-activity-template.php#L315
https://buddypress.trac.wordpress.org/browser/trunk/bp-members/bp-members-template.php#L277
This can cause issues with custom loops and I've had to workaround this in the past.
This is also causing an issue with backpat with BP_User_Query in BP 1.7. See:
https://bpdevel.wordpress.com/2012/09/07/introducing-bp_user_query/#comment-7187
---
IMO, the best way to address this for 1.7 is to modify BP_User_Query to check if the include parameter was passed. If so, we hardcode user_id to 0 before running the query. Doing it this way ensures that (hopefully) nothing will break as we transition to 1.7.
Let me know what you guys think!
Ray, is this addressed by r6638?