Skip to:
Content

BuddyPress.org

Ticket #6892: 6892.02.patch

File 6892.02.patch, 884 bytes (added by imath, 10 years ago)
  • src/bp-core/bp-core-update.php

    diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php
    index f1aedda..bb10734 100644
    function bp_version_updater() { 
    206206
    207207        require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
    208208
     209        // Used to check if we need to restore the blog
     210        $needs_reset = false;
     211
     212        if ( is_multisite() && ! bp_is_root_blog() ) {
     213                $needs_reset = true;
     214
     215                // Make sure the current blog is set to the root blog
     216                switch_to_blog( bp_get_root_blog_id() );
     217        }
     218
    209219        // Install BP schema and activate only Activity and XProfile.
    210220        if ( bp_is_install() ) {
    211221
    function bp_version_updater() { 
    272282
    273283        // Bump the version.
    274284        bp_version_bump();
     285
     286        // Restore the current blog if needed
     287        if ( true === $needs_reset ) {
     288                restore_current_blog();
     289        }
    275290}
    276291
    277292/**