#3638 closed defect (bug) (fixed)
Admin bar links point to the wrong blog on secondary sites
Reported by: | 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.
Agreed. Looks like a logic oversight, or a missing ! on bp_is_multiblog_mode()