Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4415 closed defect (bug) (fixed)

1.6 doesn't work if NOBLOGREDIRECT is defined in wp-config?

Reported by: 215's profile 215 Owned by:
Milestone: 1.6.1 Priority: normal
Severity: normal Version: 1.6
Component: Core Keywords:
Cc:

Description

Defining NOBLOGREDIRECT in wp-config worked fine in 1.5.6 but breaks buddypress in 1.6

define( 'NOBLOGREDIRECT', 'http://domain.com/' );

BP Component directories seem to work fine in 1.6 (i.e. domain.com/groups and domain.com/members) but clicking on a link (i.e. domain.com/groups/create/ or domain.com/members/superkisu/) redirects to whatever you have defined as NOBLOGREDIRECT in wp-config instead of showing the correct buddypress content.

Attachments (1)

4415.patch (2.3 KB) - added by boonebgorges 12 years ago.

Download all attachments as: .zip

Change History (5)

#1 @DJPaul
12 years ago

  • Milestone changed from Awaiting Review to 1.6.1

Not tested, but sounds possible as a result of canonical URL handling improvements made in 1.6, so putting in 1.6.1 for review.

#2 @boonebgorges
12 years ago

  • Version set to 1.6

Confirmed.

The root cause is the same as for #4329; you can read my explanation there. Briefly, because our internal content is marked 404 by WP until bp_core_load_template(); the check in maybe_redirect_404() happens before that and thus catches the incorrect 404; and the redirect takes place.

The real fix (for 1.7) will have to involve fixing the 404 issue described in #4329. (IMO it is an enormous bug and I'm not sure how we've gotten this far without it causing huge problems :) ) In the interim, I suggest 4415.patch, which unhooks and rehooks maybe_redirect_404(), so that it runs after BP's template logic (instead of being in a race condition with it). We'll remove this hack fix in 1.7, when the proper fix comes. Read my inline documentation for a more complete description of the problem and the workaround.

215, could I ask you to verify that 4415.patch fixes your issue?

Last edited 12 years ago by boonebgorges (previous) (diff)

@boonebgorges
12 years ago

#3 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6252]) When running NOBLOGREDIRECT, rehook maybe_redirect_404() to priority 100.

WP's maybe_redirect_404() must run after BuddyPress's template loader function
bp_core_load_template(), or else it'll register incorrectly as a 404 and
redirect to the value of NOBLOGREDIRECT. See inline documentation for more
details.

Fixes #4415

#4 @boonebgorges
12 years ago

(In [6253]) When running NOBLOGREDIRECT, rehook maybe_redirect_404() to priority 100.

WP's maybe_redirect_404() must run after BuddyPress's template loader function
bp_core_load_template(), or else it'll register incorrectly as a 404 and
redirect to the value of NOBLOGREDIRECT. See inline documentation for more
details.

Fixes #4415

Note: See TracTickets for help on using tickets.