Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#4563 closed defect (bug) (no action required)

BP template loops autopopulate the "user_id" parameter when on a user's page

Reported by: r-a-y's profile r-a-y 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!

Change History (3)

#1 @DJPaul
11 years ago

  • Keywords reporter-feedback added

Ray, is this addressed by r6638?

#2 @boonebgorges
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Looks like r6638 addresses this in a roundabout way. r-a-y, please reopen if it's still not working as you'd expect.

#3 @r-a-y
11 years ago

I have to remember to CC myself on my own-created tickets.

I believe it's working now. Will reopen if I encounter any wonkiness!

Note: See TracTickets for help on using tickets.