[buddypress-trac] [BuddyPress] #4563: BP template loops autopopulate the "user_id" parameter when on a user's page

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Sep 26 19:52:05 UTC 2012


#4563: BP template loops autopopulate the "user_id" parameter when on a user's
page
--------------------------+-----------------------------
 Reporter:  r-a-y         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  1.2
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 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!

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4563>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list