Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3638 closed defect (bug) (fixed)

Admin bar links point to the wrong blog on secondary sites

Reported by: boonebgorges's profile boonebgorges Owned by:
Milestone: 1.5.1 Priority: normal
Severity: normal Version: 1.5
Component: Core Keywords: has-patch needs-testing
Cc:

Description

There appears to be a logic error in bp_core_get_directory_pages() that is breaking BP links when you're on a secondary blog in the network if you're running multisite mode.

When assembling title/slug info for bp-pages, we have to make sure that we're pulling the data from the correct _posts table. The current logic is
$posts_table_name = bp_is_multiblog_mode() ? $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts' : $wpdb->posts;
In other words: get the page data from the current blog's table, unless this is multiblog mode, in which case get it from the root blog.

This seems totally reversed. In the case of multiblog mode, we should be getting the page data from the *current* blog, since the whole purpose of multiblog is to display BP content on the current blog, which means using local WP pages. In contrast, when multiblog mode is off, we should always be getting page data from the root blog.

Patch attached. I've tested it with several different kinds of setups and I'm 99% certain of my logic, but I would like someone else to verify.

Attachments (1)

3638.01.patch (925 bytes) - added by boonebgorges 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @johnjamesjacoby
13 years ago

Agreed. Looks like a logic oversight, or a missing ! on bp_is_multiblog_mode()

#2 @boonebgorges
13 years ago

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

(In [5197]) Ensures that bp-pages data is pulled from the correct blog in multiblog mode. Fixes #3638

#3 @boonebgorges
13 years ago

(In [5198]) Ensures that bp-pages data is pulled from the correct blog in multiblog mode. Fixes #3638

Note: See TracTickets for help on using tickets.