[buddypress-trac] [BuddyPress Trac] #6431: get_group_extras function doesn't "respects" the user_id variable from groups_get_groups() function

buddypress-trac noreply at wordpress.org
Tue May 12 12:49:52 UTC 2015


#6431: get_group_extras function doesn't "respects" the user_id variable from
groups_get_groups() function
--------------------------------+-----------------------------
 Reporter:  lenasterg           |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Component - Groups  |    Version:
 Severity:  normal              |   Keywords:
--------------------------------+-----------------------------
 Hi.
 I noticed the following:

 1. I was tried to get the groups details for a specific user ex.
 user_id=26 by using the function {{{ groups_get_groups() }}}.

 Example:

 {{{
  $user_id = 26;
     echo '<pre>';
     var_dump( groups_get_groups( array( 'user_id' => $user_id,
 'show_hidden' => true ) ) );
 }}}

 2. In another browser tab I was logged in with the user_id=35 (I just
 forget to log out from a previous test).

 '''Result''':
 The var_dump return the groups of user_id=26 but the fields
 {{{ ["is_member"] ["is_invited"]     ["is_pending"]     ["is_banned"]}}}
 are containing info about the loggedin user (user_id=35).


 This seems like a bug to me.


 If it is a bug, attached is a suggested patch which passes the $user_id
 variable from '''BP_Groups_Group::get()''' function (which is used in
 groups_get_groups()) into the get_group_extras() function.



 If this an expected behavior, what is the "proper" way to get the details
 for each group the user is member of?. ''(My initial intension was to
 submit an enhancement which adds the is_admin, is_mod into the
 get_group_extras() function)''

 Thanks in advance
 Lena

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


More information about the buddypress-trac mailing list