<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][4556] trunk: Ensures that upgrades from BP 1.2.x are recognized as upgrades, and previous component settings are saved.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>4556</dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2011-06-24 17:12:13 +0000 (Fri, 24 Jun 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Ensures that upgrades from BP 1.2.x are recognized as upgrades, and previous component settings are saved. Fixes #3153. Props cnorris23</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreupdatephp">trunk/bp-core/admin/bp-core-update.php</a></li>
<li><a href="#trunkbpcorebpcorefunctionsphp">trunk/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunkbpcorebpcoreloaderphp">trunk/bp-core/bp-core-loader.php</a></li>
<li><a href="#trunkbploaderphp">trunk/bp-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcoreupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-update.php (4555 => 4556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-update.php        2011-06-24 14:30:51 UTC (rev 4555)
+++ trunk/bp-core/admin/bp-core-update.php        2011-06-24 17:12:13 UTC (rev 4556)
</span><span class="lines">@@ -14,22 +14,29 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function __construct() {
</span><del>-                // Look for current DB version
-                if ( !$this->database_version = get_site_option( 'bp-db-version' ) ) {
-                        if ( $this->database_version = get_option( 'bp-db-version' ) ) {
-                                $this->is_network_activate = true;
-                        } else {
-                                if ( !$this->current_step() ) {
-                                        setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
-                                        $_COOKIE['bp-wizard-step'] = 0;
-                                }
-                        }
</del><ins>+                global $bp;
+
+                // Ensure that we have access to some utility functions
+                include( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
+
+                // Get current DB version
+                $this->database_version = !empty( $bp->database_version ) ? (int) $bp->database_version : 0;
+
+                if ( !empty( $bp->is_network_activate ) ) {
+                        $this->is_network_activate = $bp->is_network_activate;
+
+                } elseif ( !$this->current_step() ) {
+                        setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
+                        $_COOKIE['bp-wizard-step'] = 0;
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 $this->new_version = constant( 'BP_DB_VERSION' );
</span><del>-                $this->setup_type = ( empty( $this->database_version ) && !(int)get_site_option( 'bp-core-db-version' ) ) ? 'install' : 'update';
</del><ins>+                $this->setup_type = !empty( $bp->maintenance_mode ) ? $bp->maintenance_mode : '';
</ins><span class="cx">                 $this->current_step = $this->current_step();
</span><span class="cx">
</span><ins>+                // Remove the admin menu while we update/install
+                remove_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
+
</ins><span class="cx">                 // Call the save method that will save data and modify $current_step
</span><span class="cx">                 if ( isset( $_POST['save'] ) )
</span><span class="cx">                         $this->save( $_POST['save'] );
</span><span class="lines">@@ -71,10 +78,10 @@
</span><span class="cx">                         if ( $this->is_network_activate )
</span><span class="cx">                                 $steps[] = __( 'Multisite Update', 'buddypress' );
</span><span class="cx">
</span><del>-                        if ( $this->database_version < $this->new_version )
</del><ins>+                        if ( $this->database_version < (int) $this->new_version )
</ins><span class="cx">                                 $steps[] = __( 'Database Update', 'buddypress' );
</span><span class="cx">
</span><del>-                        if ( $this->database_version < 1225 || !bp_core_get_page_meta() )
</del><ins>+                        if ( $this->database_version < 1801 || !bp_core_get_page_meta() )
</ins><span class="cx">                                 $steps[] = __( 'Pages', 'buddypress' );
</span><span class="cx">
</span><span class="cx">                         $steps[] = __( 'Finish', 'buddypress' );
</span><span class="lines">@@ -264,9 +271,9 @@
</span><span class="cx">                         $blogs_slug = 'blogs';
</span><span class="cx">
</span><span class="cx">                 // Call up old bp-pages to see if a page has been previously linked to Blogs
</span><del>-                $page_blog_id                 = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
-                $existing_pages_data         = get_blog_option( $page_blog_id, 'bp-pages' );
-                $existing_pages         = $existing_pages_data[$page_blog_id];
</del><ins>+                $page_blog_id = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
+                $existing_pages_data = get_blog_option( $page_blog_id, 'bp-pages' );
+                $existing_pages = $existing_pages_data[$page_blog_id];
</ins><span class="cx">
</span><span class="cx">                 if ( !empty( $existing_pages['blogs'] ) )
</span><span class="cx">                         $existing_blog_page = '&selected=' . $existing_pages['blogs'];
</span><span class="lines">@@ -718,15 +725,21 @@
</span><span class="cx">         /** Save Step Methods *****************************************************/
</span><span class="cx">
</span><span class="cx">         function step_db_update_save() {
</span><ins>+                global $bp;
+
</ins><span class="cx">                 if ( isset( $_POST['submit'] ) ) {
</span><span class="cx">                         check_admin_referer( 'bpwizard_db_update' );
</span><span class="cx">
</span><span class="cx">                         // Run the schema install to update tables
</span><span class="cx">                         bp_core_install();
</span><span class="cx">
</span><del>-                        if ( $this->database_version < 1225 )
</del><ins>+                        if ( $this->database_version < 1801 )
</ins><span class="cx">                                 $this->update_1_3();
</span><span class="cx">
</span><ins>+                        // Update the active components option early if we're updating
+                        if ( 'update' == $this->setup_type )
+                                update_site_option( 'bp-active-components', $bp->active_components );
+
</ins><span class="cx">                         return true;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -739,14 +752,14 @@
</span><span class="cx">                 if ( isset( $_POST['submit'] ) ) {
</span><span class="cx">                         check_admin_referer( 'bpwizard_ms_update' );
</span><span class="cx">
</span><del>-                        if ( !$active_components = get_option( 'bp-active-components' ) )
</del><ins>+                        if ( !$active_components = get_site_option( 'bp-active-components' ) )
</ins><span class="cx">                                 $active_components = array();
</span><span class="cx">
</span><span class="cx">                         // Transfer important settings from blog options to site options
</span><span class="cx">                         $options = array(
</span><del>-                                'bp-db-version'                => $this->database_version,
-                                'bp-active-components'        => $active_components,
-                                'avatar-default'        => get_option( 'avatar-default' )
</del><ins>+                                'bp-db-version' => $this->database_version,
+                                'bp-active-components' => $active_components,
+                                'avatar-default' => get_option( 'avatar-default' )
</ins><span class="cx">                         );
</span><span class="cx">                         bp_core_activate_site_options( $options );
</span><span class="cx">
</span><span class="lines">@@ -758,12 +771,12 @@
</span><span class="cx">                                         switch_to_blog( BP_ROOT_BLOG );
</span><span class="cx">
</span><span class="cx">                                 // Move bp-pages data from the blog options table to site options
</span><del>-                                $page_blog_id                 = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
-                                $existing_pages_data         = get_blog_option( $page_blog_id, 'bp-pages' );
-                                $existing_pages         = $existing_pages_data[$page_blog_id];
</del><ins>+                                $page_blog_id = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
+                                $existing_pages_data = get_blog_option( $page_blog_id, 'bp-pages' );
+                                $existing_pages = $existing_pages_data[$page_blog_id];
</ins><span class="cx">
</span><del>-                                $bp_pages         = $this->setup_pages( (array)$_POST['bp_pages'] );
-                                $bp_pages         = array_merge( (array)$existing_pages, (array)$bp_pages );
</del><ins>+                                $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] );
+                                $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages );
</ins><span class="cx">
</span><span class="cx">                                 $existing_pages_data[$page_blog_id] = $bp_pages;
</span><span class="cx">
</span><span class="lines">@@ -821,9 +834,9 @@
</span><span class="cx">                         foreach ( (array)$existing_pages as $page_id )
</span><span class="cx">                                 wp_delete_post( $page_id, true );
</span><span class="cx">
</span><del>-                        $blog_pages         = $this->setup_pages( (array)$_POST['bp_pages'] );
-                        $page_blog_id         = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
-                        $bp_pages        = array( $page_blog_id => $blog_pages );
</del><ins>+                        $blog_pages = $this->setup_pages( (array)$_POST['bp_pages'] );
+                        $page_blog_id = is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ? get_current_blog_id() : BP_ROOT_BLOG;
+                        $bp_pages = array( $page_blog_id => $blog_pages );
</ins><span class="cx">
</span><span class="cx">                         update_site_option( 'bp-pages', $bp_pages );
</span><span class="cx">
</span><span class="lines">@@ -994,7 +1007,7 @@
</span><span class="cx">                         check_admin_referer( 'bpwizard_finish' );
</span><span class="cx">
</span><span class="cx">                         // Update the DB version in the database
</span><del>-                        update_site_option( 'bp-db-version', constant( 'BP_DB_VERSION' ) );
</del><ins>+                        update_site_option( 'bp-db-version', $this->new_version );
</ins><span class="cx">                         delete_site_option( 'bp-core-db-version' );
</span><span class="cx">
</span><span class="cx">                         // Delete the setup cookie
</span><span class="lines">@@ -1180,16 +1193,16 @@
</span><span class="cx"> * @uses add_submenu_page() WP function to add a submenu item
</span><span class="cx"> */
</span><span class="cx"> function bp_core_update_add_admin_menu() {
</span><del>-        global $bp, $bp_wizard;
</del><ins>+        global $bp_wizard;
</ins><span class="cx">
</span><span class="cx">         // Only load this version of the menu if this is an upgrade or a new installation
</span><del>-        if ( empty( $bp->maintenence_mode ) )
</del><ins>+        if ( empty( $bp_wizard->setup_type ) )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         if ( !current_user_can( 'activate_plugins' ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        if ( '' == get_site_option( 'bp-db-version' ) && !(int)get_site_option( 'bp-core-db-version' ) && !$bp_wizard->is_network_activate )
</del><ins>+        if ( 'install' == $bp_wizard->setup_type )
</ins><span class="cx">                 $status = __( 'Setup', 'buddypress' );
</span><span class="cx">         else
</span><span class="cx">                 $status = __( 'Update', 'buddypress' );
</span><span class="lines">@@ -1277,8 +1290,11 @@
</span><span class="cx"> * @global $pagenow The current admin page
</span><span class="cx"> */
</span><span class="cx"> function bp_core_update_nag() {
</span><del>-        global $bp, $pagenow;
</del><ins>+        global $bp_wizard, $pagenow;
</ins><span class="cx">
</span><ins>+        if ( empty( $bp_wizard->setup_type ) )
+                return;
+
</ins><span class="cx">         if ( !is_super_admin() )
</span><span class="cx">                 return;
</span><span class="cx">
</span><span class="lines">@@ -1287,7 +1303,7 @@
</span><span class="cx">
</span><span class="cx">         $url = bp_core_update_do_network_admin() ? network_admin_url( 'admin.php?page=bp-wizard' ) : admin_url( 'admin.php?page=bp-wizard' );
</span><span class="cx">
</span><del>-        switch( $bp->maintenence_mode ) {
</del><ins>+        switch( $bp_wizard->setup_type ) {
</ins><span class="cx">                 case 'update':
</span><span class="cx">                         $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url );
</span><span class="cx">                         break;
</span></span></pre></div>
<a id="trunkbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-functions.php (4555 => 4556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-functions.php        2011-06-24 14:30:51 UTC (rev 4555)
+++ trunk/bp-core/bp-core-functions.php        2011-06-24 17:12:13 UTC (rev 4556)
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx">                 return;
</span><span class="cx">
</span><span class="cx">         // Don't show these messages during setup or upgrade
</span><del>-        if ( isset( $bp->maintenence_mode ) )
</del><ins>+        if ( isset( $bp->maintenance_mode ) )
</ins><span class="cx">                 return;
</span><span class="cx">
</span><span class="cx">         /**
</span></span></pre></div>
<a id="trunkbpcorebpcoreloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-loader.php (4555 => 4556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-loader.php        2011-06-24 14:30:51 UTC (rev 4555)
+++ trunk/bp-core/bp-core-loader.php        2011-06-24 17:12:13 UTC (rev 4556)
</span><span class="lines">@@ -53,35 +53,54 @@
</span><span class="cx">
</span><span class="cx">                 /** Components ********************************************************/
</span><span class="cx">
</span><del>-                // Set the included and optional components
-                $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile', ) );
</del><ins>+                // Set the included and optional components.
+                $bp->optional_components = array( 'activity', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile', );
</ins><span class="cx">
</span><ins>+                // Blogs component only available for multisite
+                if ( is_multisite() )
+                        $bp->optional_components[] = 'blogs';
+
+                $bp->optional_components = apply_filters( 'bp_optional_components', $bp->optional_components );
+
</ins><span class="cx">                 // Set the required components
</span><del>-                $bp->required_components = apply_filters( 'bp_required_components', array( 'members', ) );
</del><ins>+                $bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
</ins><span class="cx">
</span><span class="cx">                 // Get a list of activated components
</span><span class="cx">                 if ( $active_components = get_site_option( 'bp-active-components' ) ) {
</span><del>-                        $bp->active_components = apply_filters( 'bp_active_components', $active_components );
</del><ins>+                        $bp->active_components = apply_filters( 'bp_active_components', $active_components );
</ins><span class="cx">                         $bp->deactivated_components = apply_filters( 'bp_deactivated_components', array_values( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_keys( $bp->active_components ) ) ) );
</span><span class="cx">
</span><span class="cx">                 // Pre 1.3 Backwards compatibility
</span><span class="cx">                 } elseif ( $deactivated_components = get_site_option( 'bp-deactivated-components' ) ) {
</span><span class="cx">                         // Trim off namespace and filename
</span><del>-                        foreach ( $deactivated_components as $component => $value )
</del><ins>+                        foreach ( (array) $deactivated_components as $component => $value )
</ins><span class="cx">                                 $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
</span><span class="cx">
</span><span class="cx">                         // Set globals
</span><span class="cx">                         $bp->deactivated_components = apply_filters( 'bp_deactivated_components', $trimmed );
</span><span class="cx">
</span><span class="cx">                         // Setup the active components
</span><del>-                        $active_components = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) );
</del><ins>+                        $active_components = array_flip( array_diff( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), array_values( $bp->deactivated_components ) ) );
</ins><span class="cx">
</span><span class="cx">                         // Loop through active components and set the values
</span><del>-                        foreach( $active_components as $component => $value )
-                                $bp->active_components[$component] = 1;
</del><ins>+                        $bp->active_components = array_map( '__return_true', $active_components );
</ins><span class="cx">
</span><span class="cx">                         // Set the active component global
</span><del>-                        $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
</del><ins>+                        $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
+
+                // Default to all components active
+                } else {
+                        // Set globals
+                        $bp->deactivated_components = array();
+
+                        // Setup the active components
+                        $active_components = array_flip( array_values( array_merge( $bp->optional_components, $bp->required_components ) ) );
+
+                        // Loop through active components and set the values
+                        $bp->active_components = array_map( '__return_true', $active_components );
+
+                        // Set the active component global
+                        $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components );
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 // Loop through optional components
</span><span class="lines">@@ -215,4 +234,4 @@
</span><span class="cx"> // Initialize the BuddyPress Core
</span><span class="cx"> $bp->core = new BP_Core();
</span><span class="cx">
</span><del>-?>
</del><ins>+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkbploaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-loader.php (4555 => 4556)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-loader.php        2011-06-24 14:30:51 UTC (rev 4555)
+++ trunk/bp-loader.php        2011-06-24 17:12:13 UTC (rev 4556)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> // Test to see whether this is a new installation or an upgraded version of BuddyPress
</span><span class="cx"> if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) {
</span><span class="cx">         if ( $bp->database_version = get_option( 'bp-db-version' ) ) {
</span><del>-                $bp->is_ms_activate = 1;
</del><ins>+                $bp->is_network_activate = 1;
</ins><span class="cx">         } else {
</span><span class="cx">                 $bp->database_version = get_site_option( 'bp-core-db-version' ); // BP 1.2 option
</span><span class="cx">         }
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">
</span><span class="cx"> // This is a new installation.
</span><span class="cx"> if ( empty( $bp->database_version ) ) {
</span><del>-        $bp->maintenence_mode = 'install';
</del><ins>+        $bp->maintenance_mode = 'install';
</ins><span class="cx">         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
</span><span class="cx">
</span><span class="cx"> // There is a previous installation
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx">         require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-loader.php' );
</span><span class="cx">
</span><span class="cx">         // Check if an update is required
</span><del>-        if ( (int)$bp->database_version < (int)constant( 'BP_DB_VERSION' ) || isset( $bp->is_ms_activate ) ) {
-                $bp->maintenence_mode = 'update';
</del><ins>+        if ( (int)$bp->database_version < (int)constant( 'BP_DB_VERSION' ) || isset( $bp->is_network_activate ) ) {
+                $bp->maintenance_mode = 'update';
</ins><span class="cx">                 require_once( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-update.php' );
</span><span class="cx">         }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>