[buddypress-trac] [BuddyPress] #3638: Admin bar links point to the wrong blog on secondary sites

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Sep 30 14:29:05 UTC 2011


#3638: Admin bar links point to the wrong blog on secondary sites
--------------------------+-------------------------------------
 Reporter:  boonebgorges  |      Owner:
     Type:  defect        |     Status:  new
 Priority:  normal        |  Milestone:  1.5.1
Component:  Core          |    Version:  1.5
 Severity:  normal        |   Keywords:  has-patch needs-testing
--------------------------+-------------------------------------
 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.

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


More information about the buddypress-trac mailing list