Making WordPress.org

Opened 3 years ago

Closed 13 months ago

#6200 closed defect (bug) (fixed)

https://profiles.wordpress.org/associations/community-team/ page displays blank

Reported by: yoga1103's profile yoga1103 Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Profiles Keywords: close
Cc:

Description

These pages: https://profiles.wordpress.org/associations/community-team/
and https://profiles.wordpress.org/associations/community-contributor/

don't display any content, they return just a blank page.

checked on Ubuntu desktop Firefox (85.0) browser and android chrome browser. Both the times blank page.

Change History (4)

#1 @dd32
3 years ago

  • Component changed from General to Profiles

This is caused by a conflict between Gutenberg and BuddyPress.

The bp-default theme directory is registered on the plugins_loaded hook ( plugins_loaded => bp_loaded => bp_register_theme_directory => register_theme_directory() ).

Gutenberg has decided that it should run code upon plugin inclusion, instead of waiting for plugins_loaded like a good plugin, one of which is wp_is_block_theme() which has to create a WP_Theme object, before the BuddyPress theme is registered.

require('wp-blog-header.php'),
require_once('wp-load.php'),
require_once('wp-config.php'),
require_once('wp-settings.php'), 
include_once('/plugins/gutenberg/gutenberg.php'),
gutenberg_pre_init,
require_once('/plugins/gutenberg/lib/load.php'),
require('/plugins/gutenberg/lib/compat/wordpress-5.9/default-theme-supports.php'),
wp_is_block_theme,
wp_get_theme,
WP_Theme->__construct
 /// This is the point where the `bp-default` theme isn't yet registered, because BuddyPress hasn't loaded.

This should probably be called a Gutenberg bug, but I guess BuddyPress could also consider loading earlier.. but.. it shouldn't have to.

Last edited 3 years ago by dd32 (previous) (diff)

#2 @dd32
3 years ago

  • Keywords close added
  • Owner set to dd32
  • Status changed from new to accepted

This is temporarily fixed. I've added a mu-plugin that takes care of it for now.

<?php
/**
 * Plugin Name: Meta#6200: Temporary for BuddyPress+Gutenberg+bp-default
 * Plugin URI: https://meta.trac.wordpress.org/ticket/6200#comment:1
 */

/**
 * Register the BuddyPress theme directory early, because Gutenberg.
 * 
 * @see https://meta.trac.wordpress.org/ticket/6200#comment:1
 */
function register_bp_default_early() {
        // BuddyPress is a network plugin, which are loaded prior to muplugins_loaded firing.
        if ( ! function_exists( 'buddypress' ) ) {
                return;
        }

        // If we don't need the bp-default theme, no need to do anything.
        if ( 'bp-default' !== get_template() ) {
                return;
        }

        // Gutenberg should be within the per-site plugin list.
        // If Gutenberg is network-activated, this will fail and cause the same problem that we're trying to fix.
        if ( in_array( 'gutenberg/gutenberg.php', (array) get_option( 'active_plugins', [] ) ) ) {
                register_theme_directory( buddypress()->old_themes_dir );
        }
}
add_action( 'muplugins_loaded', 'register_bp_default_early' );

Leaving this open to track the removal of it / fix in Gutenberg / BuddyPress.

#3 @tellyworth
2 years ago

Is there an update on this? Can we close as fixed?

#4 @dd32
13 months ago

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

I've removed the hotfix added above and nothing imploded, I'm marking this as fixed.

Note: See TracTickets for help on using tickets.