[buddypress-trac] [BuddyPress Trac] #5427: group_id cannot be passed to bp_group_has_invites()

buddypress-trac noreply at wordpress.org
Tue Feb 25 14:36:57 UTC 2014


#5427: group_id cannot be passed to bp_group_has_invites()
--------------------------+-----------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  2.0
Component:  Groups        |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------
 It's not possible to pass a $group_id to `bp_group_has_invites()`. The
 `extract( $r, EXTR_SKIP )` prevents the `$group_id` parameter from being
 populated, because the global `$group_id` is being invoked. In most cases,
 we don't notice this, because it triggers the `if ( ! $group_id )` block
 (3160), but if you try to call from outside a group page, everything
 breaks.

 The fact that we're passing around a `$group_id` global is pretty
 terrible. We need to do it because of how the group_id is set in
 `BP_Groups_Invite_Template::the_invite()`. This could use a better
 workaround, but in the meantime a simple fix is to remove the crummy call
 to `$extract` and set the global more intelligently.

 https://buddypress.trac.wordpress.org/browser/trunk/bp-groups/bp-groups-
 template.php#L3149

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


More information about the buddypress-trac mailing list