[buddypress-trac] [BuddyPress] #4706: Infinite Redirect Loop when BP_GROUPS_DEFAULT_EXTENSION is changed on Private groups
buddypress-trac
noreply at wordpress.org
Fri Dec 7 03:18:25 UTC 2012
#4706: Infinite Redirect Loop when BP_GROUPS_DEFAULT_EXTENSION is changed on
Private groups
--------------------------+-----------------------------
Reporter: DennisSmolek | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 1.6.1
Severity: major | Keywords:
--------------------------+-----------------------------
When you change the default extension of your groups to something besides
home (say forums) and the group is listed as private it causes a infinite
redirection loop.
See: http://buddypress.org/support/topic/changing-group-home-page-causes-
infinite-loop-in-private-groups/
its an easy fix to just add the /home/ to the default path in the setup
globals function of /bp-groups/bp-groups-loader.php (line: 270ish)
This is the area of code modified
{{{
if ( !$this->current_group->user_has_access ) {
// Hidden groups should return a 404 for
non-members.
// Unset the current group so that you're
not redirected
// to the default group tab
if ( 'hidden' ==
$this->current_group->status ) {
$this->current_group = 0;
$bp->is_single_item = false;
bp_do_404();
return;
// Skip the no_access check on home and
membership request pages
} elseif ( !bp_is_current_action( 'home' )
&& !bp_is_current_action( 'request-membership' ) ) {
// Off-limits to this user. Throw
an error and redirect to the group's home page
if ( is_user_logged_in() ) {
bp_core_no_access( array(
'message' => __(
'You do not have access to this group.', 'buddypress' ),
'root' =>
bp_get_group_permalink( $bp->groups->current_group ) . '/home/',
'redirect' =>
false
) );
// User does not have access, and
does not get a message
} else {
bp_core_no_access();
}
}
}
}}}
Major note for people finding this, some plugins like Group Hierarchy
extend the groups component class and overwrite the setup globals function
so even if this gets changed it will cause an error until they update (or
you go crazy trying to figure it out like me)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4706>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list