<!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][5754] trunk: Bump default DB version in bp-core-options.php.</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><a href="http://buddypress.trac.wordpress.org/changeset/5754">5754</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-02-13 05:04:53 +0000 (Mon, 13 Feb 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Bump default DB version in bp-core-options.php. Use bp_bump_version() where needed. Update activation/deactivation hooks, and prevent activation error from function not existing. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3967">#3967</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreupdatephp">trunk/bp-core/admin/bp-core-update.php</a></li>
<li><a href="#trunkbpcorebpcorehooksphp">trunk/bp-core/bp-core-hooks.php</a></li>
<li><a href="#trunkbpcorebpcoreoptionsphp">trunk/bp-core/bp-core-options.php</a></li>
<li><a href="#trunkbpcorebpcoreupdatephp">trunk/bp-core/bp-core-update.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 (5753 => 5754)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-update.php        2012-02-13 04:38:57 UTC (rev 5753)
+++ trunk/bp-core/admin/bp-core-update.php        2012-02-13 05:04:53 UTC (rev 5754)
</span><span class="lines">@@ -1,4 +1,5 @@
</span><span class="cx"> <?php
</span><ins>+
</ins><span class="cx"> // Exit if accessed directly
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="lines">@@ -19,10 +20,6 @@
</span><span class="cx">
</span><span class="cx">         function __construct() {
</span><span class="cx">
</span><del>-                // Ensure that we have access to some utility functions. Must use require_once()
-                // because BP Core is loaded during incremental upgrades
-                require_once( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' );
-
</del><span class="cx">                 // Set/reset the wizard cookie
</span><span class="cx">                 setcookie( 'bp-wizard-step', 0, time() + 60 * 60 * 24, COOKIEPATH );
</span><span class="cx">                 $_COOKIE['bp-wizard-step'] = 0;
</span><span class="lines">@@ -54,6 +51,7 @@
</span><span class="cx">                 // Setup wizard steps
</span><span class="cx">                 $steps = array();
</span><span class="cx">
</span><ins>+                // This is a first time installation
</ins><span class="cx">                 if ( bp_get_maintenance_mode() == 'install' ) {
</span><span class="cx">                         $steps = array(
</span><span class="cx">                                 __( 'Components', 'buddypress' ),
</span><span class="lines">@@ -63,11 +61,12 @@
</span><span class="cx">                                 __( 'Finish', 'buddypress' )
</span><span class="cx">                         );
</span><span class="cx">
</span><del>-                // Update wizard steps
</del><ins>+                // This is an update to an existing install
</ins><span class="cx">                 } else {
</span><span class="cx">
</span><del>-                        if ( bp_get_db_version_raw() < (int) bp_get_db_version() )
</del><ins>+                        if ( bp_get_db_version_raw() < (int) bp_get_db_version() ) {
</ins><span class="cx">                                 $steps[] = __( 'Database Update', 'buddypress' );
</span><ins>+                        }
</ins><span class="cx">
</span><span class="cx">                         // New for BP 1.5
</span><span class="cx">                         if ( bp_get_db_version_raw() < 1801 || !bp_core_get_directory_page_ids() ) {
</span><span class="lines">@@ -76,8 +75,9 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         // New for BP 1.6
</span><del>-                        if ( bp_get_db_version_raw() < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) )
</del><ins>+                        if ( bp_get_db_version_raw() < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) ) {
</ins><span class="cx">                                 $steps[] = __( 'Admin Bar', 'buddypress' );
</span><ins>+                        }
</ins><span class="cx">
</span><span class="cx">                         $steps[] = __( 'Finish', 'buddypress' );
</span><span class="cx">                 }
</span><span class="lines">@@ -961,8 +961,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>-                        // Stored in sitemeta. Do not use bp_update_option()
-                        update_blog_option( bp_get_root_blog_id(), '_bp_db_version', bp_get_db_version() );
</del><ins>+                        bp_version_bump();
</ins><span class="cx">
</span><span class="cx">                         // Delete the setup cookie
</span><span class="cx">                         @setcookie( 'bp-wizard-step', '', time() - 3600, COOKIEPATH );
</span></span></pre></div>
<a id="trunkbpcorebpcorehooksphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-hooks.php (5753 => 5754)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-hooks.php        2012-02-13 04:38:57 UTC (rev 5753)
+++ trunk/bp-core/bp-core-hooks.php        2012-02-13 05:04:53 UTC (rev 5754)
</span><span class="lines">@@ -165,41 +165,6 @@
</span><span class="cx">         do_action( 'bp_screens' );
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/** Activation Actions ********************************************************/
-
-/**
- * Runs on BuddyPress activation
- *
- * @since BuddyPress (1.6)
- *
- * @uses do_action() Calls 'bp_activation' hook
- */
-function bp_activation() {
-        do_action( 'bp_activation' );
-}
-
-/**
- * Runs on BuddyPress deactivation
- *
- * @since BuddyPress (1.6)
- *
- * @uses do_action() Calls 'bp_deactivation' hook
- */
-function bp_deactivation() {
-        do_action( 'bp_deactivation' );
-}
-
-/**
- * Runs when uninstalling BuddyPress
- *
- * @since BuddyPress (1.6)
- *
- * @uses do_action() Calls 'bp_uninstall' hook
- */
-function bp_uninstall() {
-        do_action( 'bp_uninstall' );
-}
-
</del><span class="cx"> /** Admin *********************************************************************/
</span><span class="cx">
</span><span class="cx"> if ( is_admin() ) {
</span></span></pre></div>
<a id="trunkbpcorebpcoreoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-options.php (5753 => 5754)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-options.php        2012-02-13 04:38:57 UTC (rev 5753)
+++ trunk/bp-core/bp-core-options.php        2012-02-13 05:04:53 UTC (rev 5754)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">
</span><span class="cx">                 /** DB Version ********************************************************/
</span><span class="cx">
</span><del>-                '_bp_db_version' => '155',
</del><ins>+                '_bp_db_version' => '5249',
</ins><span class="cx">
</span><span class="cx">                 /** Components ********************************************************/
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpcorebpcoreupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-update.php (5753 => 5754)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-update.php        2012-02-13 04:38:57 UTC (rev 5753)
+++ trunk/bp-core/bp-core-update.php        2012-02-13 05:04:53 UTC (rev 5754)
</span><span class="lines">@@ -143,4 +143,55 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/** Activation Actions ********************************************************/
+
+/**
+ * Runs on BuddyPress activation
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_activation' hook
+ */
+function bp_activation() {
+
+        // Force refresh theme roots.
+        delete_site_transient( 'theme_roots' );
+
+        // Use as of (1.6)
+        do_action( 'bp_activation' );
+
+        // @deprecated as of (1.6)
+        do_action( 'bp_loader_activate' );
+}
+
+/**
+ * Runs on BuddyPress deactivation
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_deactivation' hook
+ */
+function bp_deactivation() {
+
+        // Force refresh theme roots.
+        delete_site_transient( 'theme_roots' );
+
+        // Use as of (1.6)
+        do_action( 'bp_deactivation' );
+
+        // @deprecated as of (1.6)
+        do_action( 'bp_loader_deactivate' );
+}
+
+/**
+ * Runs when uninstalling BuddyPress
+ *
+ * @since BuddyPress (1.6)
+ *
+ * @uses do_action() Calls 'bp_uninstall' hook
+ */
+function bp_uninstall() {
+        do_action( 'bp_uninstall' );
+}
+
</ins><span class="cx"> ?>
</span></span></pre></div>
<a id="trunkbploaderphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-loader.php (5753 => 5754)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-loader.php        2012-02-13 04:38:57 UTC (rev 5753)
+++ trunk/bp-loader.php        2012-02-13 05:04:53 UTC (rev 5754)
</span><span class="lines">@@ -564,46 +564,4 @@
</span><span class="cx">
</span><span class="cx"> endif;
</span><span class="cx">
</span><del>-/** Activation ****************************************************************/
-
-// @todo Move this code into bp-core-update.php
-
-if ( !function_exists( 'bp_loader_activate' ) ) :
-/**
- * Defines BP's activation routine.
- *
- * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some
- * issues with incompatible legacy themes, and provides a hook for other functions to know that
- * BP has been activated.
- *
- * @package BuddyPress Core
-*/
-function bp_loader_activate() {
-        // Force refresh theme roots.
-        delete_site_transient( 'theme_roots' );
-
-        if ( !function_exists( 'get_blog_option' ) )
-                require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-wpabstraction.php' );
-
-        if ( !function_exists( 'bp_get_root_blog_id' ) )
-                require ( WP_PLUGIN_DIR . '/buddypress/bp-core/bp-core-functions.php' );
-
-        // Switch the user to the new bp-default if they are using the old
-        // bp-default on activation.
-        if ( 'bp-sn-parent' == get_blog_option( bp_get_root_blog_id(), 'template' ) && 'bp-default' == get_blog_option( bp_get_root_blog_id(), 'stylesheet' ) )
-                switch_theme( 'bp-default', 'bp-default' );
-
-        do_action( 'bp_loader_activate' );
-}
-register_activation_hook( 'buddypress/bp-loader.php', 'bp_loader_activate' );
-endif;
-
-if ( !function_exists( 'bp_loader_deactivate' ) ) :
-// Deactivation Function
-function bp_loader_deactivate() {
-        do_action( 'bp_loader_deactivate' );
-}
-register_deactivation_hook( 'buddypress/bp-loader.php', 'bp_loader_deactivate' );
-endif;
-
-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre>
</div>
</div>
</body>
</html>