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: |
|
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'.
Andy explained this:
$bp['current_userid']
is only valid when executing code in the member theme.