Skip to:
Content

BuddyPress.org

Ticket #918: load-ordering-fix.patch

File load-ordering-fix.patch, 1.2 KB (added by junsuijin, 15 years ago)
  • bp-forums-bbpress.php

     
    3838       
    3939        require_once( BACKPRESS_PATH . 'class.wp-taxonomy.php' );
    4040        require_once( BB_PATH . BB_INC . 'class.bb-taxonomy.php' );
    41        
    42         require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
    4341
    4442        $bb = new stdClass();
    4543        require_once( $bp->forums->bbconfig );
     
    6967        $bbdb->prefix = $bb_table_prefix;
    7068
    7169        define( 'BB_INSTALLING', false );
     70
     71        if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
     72                require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
     73
     74        require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
    7275       
    7376        if ( is_object( $wp_roles ) ) {
    7477                $bb_roles =& $wp_roles;
     
    9295                $bb->site_id = BP_ROOT_BLOG;
    9396
    9497        /* Check if the tables are installed, if not, install them */
    95         if ( !(boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) ) {
     98        if ( !$tables_installed ) {
    9699                require_once( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' );
    97                 require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
    98100
    99101                dbDelta( $bb_queries );
    100102