Skip to:
Content

BuddyPress.org

Opened 18 years ago

Closed 18 years ago

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

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

Reported by: burtadsit Owned by:
Priority: minor Milestone:
Component: Version:
Severity: 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
18 years ago

  • Priority majorminor

#2 @burtadsit
18 years ago

  • Resolutioninvalid
  • Status newclosed

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

Note: See TracTickets for help on using tickets.