Skip to:
Content

BuddyPress.org

Opened 23 months ago

Closed 10 months ago

Last modified 10 months ago

#9259 closed defect (bug) (fixed)

page_on_front dropdown on secondary sites includes items from root site

Reported by: boonebgorges Owned by: espellcaste
Priority: normal Milestone: 14.5.0
Component: Administration Version: 14.1.0
Severity: normal Keywords:
Cc:

Description

Setup:

  • Multisite
  • BP 14.1.0, activated networkwide
  • BP Classic 1.4.0, activated networkwide

When visiting Dashboard > Settings > Reading on a secondary site (ie not the root blog), the page_on_front dropdown includes the bp_pages items from the root blog.

Related: #9052

Seems like we should simply be bailing out of the function (or not hooking the callback to 'get_pages' at all) when ! bp_is_root_blog(), but happy to hear other ideas.

Attachments (1)

9259.patch​ (499 bytes ) - added by vapvarun 10 months ago.

Download all attachments as: .zip

Change History (7)

#1 @espellcaste
10 months ago

  • Component Core → Blogs
  • Milestone Awaiting Review → 15.0.0

#2 @vapvarun
10 months ago

Attaching a patch that implements the suggested fix - bailing out of bp_core_include_directory_on_front() when not on the root blog.

The Change:

// BP pages are only relevant on the root blog in multisite.
if ( ! bp_is_root_blog() ) {
    return $pages;
}

This check is added right after the existing query parser check, so on secondary sites in multisite, the function returns early and doesn't add BP directory pages to the page_on_front dropdown.

Testing (subdirectory multisite):

=== ROOT BLOG (site 1) ===
bp_is_root_blog(): true
Homepage dropdown options: Activity, Groups, Members, Sample Page, Sites

=== SECONDARY SITE ===
bp_is_root_blog(): false
Homepage dropdown options: Sample Page (only)

Verified in browser - BP pages from the root site no longer appear in the Settings > Reading > Homepage dropdown on secondary sites.

@vapvarun
10 months ago

#3 @espellcaste
10 months ago

  • Component Blogs → Administration
  • Milestone 15.0.0 → 14.5.0
  • Version → 14.1.0

Moving this to 14.5 since it is a small fix. I was able to confirm it too. Good catch.

#4 @espellcaste
10 months ago

One minor correction in my testing. This issue would never happen with "BP Classic 1.4.0, activated networkwide". Since bp_core_get_query_parser returns rewrites. So my guess is @boonebgorges that this plugin is inactive for you? That's a typo, right?!

#5 @espellcaste
10 months ago

  • Owner set to espellcaste
  • Resolution → fixed
  • Status new → closed

In 14183:

Stop (root blog) BuddyPress directories from showing in the WP Dropdown pages control.

BuddyPress appends its directories to the WP Dropdown pages control. However, secondary sites can not use BuddyPress directories as their front-end pages.

Props boonebgorges and vapvarun.

Fixes #9259 (trunk)

#6 @espellcaste
10 months ago

This went to 14 as part of [14182]. But due to a typo in my message, it got committed but without its full commit message.

Last edited 10 months ago by espellcaste (previous) (diff)
Note: See TracTickets for help on using tickets.