Skip to:
Content

BuddyPress.org

Opened 16 years ago

Closed 16 years ago

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

$bp['current_userid'] and $bp['loggedin_userid'] vars out of sync

Reported by: burtadsit's profile burtadsit Owned by:
Milestone: Priority: minor
Severity: Version:
Component: Keywords:
Cc:

Description

The function groups_get_user_groups() doesn't return a logged in user's groups until the user uses a bp component. The var $bpcurrent_userid? is NULL until component access. This happens when running a non-bp theme. I had to go to BP_Groups_Member::get_group_ids() with 'loggedin_userid'.

I'm not sure where to use 'current' or 'loggedin'. I don't get to specify with groups_get_user_groups(). Worked around it by going to the class.

Also when I was looking around for how to get all of a user's groups, I ran across a bug in bp-groups-templatetags.php. The constructor for BP_Groups_Template on line 94 calls groups_get_user_groups() with 'current_userid', 'pag_num', 'pag'.

Should be 'pag_num', 'pag'.

Change History (2)

#1 @burtadsit
16 years ago

  • Priority changed from major to minor

#2 @burtadsit
16 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Andy explained this: $bp['current_userid'] is only valid when executing code in the member theme.

Note: See TracTickets for help on using tickets.