<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[BuddyPress] [3357] trunk: Fix some wp_debug warnings.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>3357</dd>
<dt>Author</dt> <dd>djpaul</dd>
<dt>Date</dt> <dd>2010-11-05 21:37:15 +0000 (Fri, 05 Nov 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix some wp_debug warnings.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoreavatarsphp">trunk/bp-core/bp-core-avatars.php</a></li>
<li><a href="#trunkbpcorebpcorecatchuriphp">trunk/bp-core/bp-core-catchuri.php</a></li>
<li><a href="#trunkbpcorebpcorenotificationsphp">trunk/bp-core/bp-core-notifications.php</a></li>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpcorephp">trunk/bp-core.php</a></li>
<li><a href="#trunkbpforumsphp">trunk/bp-forums.php</a></li>
<li><a href="#trunkbpgroupsphp">trunk/bp-groups.php</a></li>
<li><a href="#trunkbpmessagesphp">trunk/bp-messages.php</a></li>
<li><a href="#trunkbpxprofilebpxprofileclassesphp">trunk/bp-xprofile/bp-xprofile-classes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoreavatarsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-avatars.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-avatars.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-core/bp-core-avatars.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">                 define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 );
</span><span class="cx">
</span><span class="cx">         if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
</span><del>-                if ( !$bp->site_options['fileupload_maxk'] )
</del><ins>+                if ( !isset( $bp->site_options['fileupload_maxk'] ) )
</ins><span class="cx">                         define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */
</span><span class="cx">                 else
</span><span class="cx">                         define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
</span></span></pre></div>
<a id="trunkbpcorebpcorecatchuriphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-catchuri.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-catchuri.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-core/bp-core-catchuri.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">                         for ( $i = 0; $i < $uri_offset; $i++ )
</span><span class="cx">                                 unset( $bp_uri[$i] );
</span><span class="cx">
</span><del>-                        $current_component = $bp_uri[$uri_offset];
</del><ins>+                        $current_component = isset( $bp_uri[$uri_offset] ) ? $bp_uri[$uri_offset] : '';
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">                 $i = 1;
</span><span class="cx">
</span><span class="cx">         // Set the current action
</span><del>-        $current_action = $bp_uri[$i];
</del><ins>+        $current_action = isset( $bp_uri[$i] ) ? $bp_uri[$i] : '';
</ins><span class="cx">
</span><span class="cx">         // Unset the current_component and action from action_variables
</span><span class="cx">         for ( $j = 0; $j <= $i; $j++ )
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">         $action_variables = $bp_uri;
</span><span class="cx">
</span><span class="cx">         // Remove the username from action variables if this is not a VHOST install
</span><del>-        if ( 'no' == VHOST && !$is_root_component )
</del><ins>+        if ( defined( 'VHOST' ) && 'no' == VHOST && !$is_root_component )
</ins><span class="cx">                 array_shift($bp_uri);
</span><span class="cx">
</span><span class="cx">         // Reset the keys by merging with an empty array
</span></span></pre></div>
<a id="trunkbpcorebpcorenotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-notifications.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-notifications.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-core/bp-core-notifications.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -42,11 +42,10 @@
</span><span class="cx">         /* Group notifications by component and component_action and provide totals */
</span><span class="cx">         for ( $i = 0; $i < count($notifications); $i++ ) {
</span><span class="cx">                 $notification = $notifications[$i];
</span><del>-
</del><span class="cx">                 $grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ( !$grouped_notifications )
</del><ins>+        if ( empty( $grouped_notifications ) )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         /* Calculated a renderable outcome for each notification type */
</span></span></pre></div>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-core/bp-core-templatetags.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -1568,7 +1568,7 @@
</span><span class="cx"> function bp_is_blogs_component() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( BP_BLOGS_SLUG == $bp->current_component )
</del><ins>+        if ( is_multisite() && BP_BLOGS_SLUG == $bp->current_component )
</ins><span class="cx">                 return true;
</span><span class="cx">
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkbpcorephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-core.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -146,7 +146,8 @@
</span><span class="cx">         $bp->active_components = array();
</span><span class="cx">
</span><span class="cx">         /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
</span><del>-        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $bp->site_options['user-avatar-default'] );
</del><ins>+        $default_grav = isset( $bp->site_options['user-avatar-default'] ) ? $bp->site_options['user-avatar-default'] : 'wavatar';
+        $bp->grav_default->user = apply_filters( 'bp_user_gravatar_default', $default_grav );
</ins><span class="cx">         $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
</span><span class="cx">         $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
</span><span class="cx">
</span><span class="lines">@@ -1017,10 +1018,10 @@
</span><span class="cx">                 if ( empty( $user_nicename ) && empty( $user_login ) ) {
</span><span class="cx">                         $ud = false;
</span><span class="cx">
</span><del>-                        if ( $bp->loggedin_user->id == $user_id )
</del><ins>+                        if ( isset( $bp->loggedin_user->id ) && $bp->loggedin_user->id == $user_id )
</ins><span class="cx">                                 $ud = &$bp->loggedin_user->userdata;
</span><span class="cx">
</span><del>-                        if ( $bp->displayed_user->id == $user_id )
</del><ins>+                        if ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id == $user_id )
</ins><span class="cx">                                 $ud = &$bp->displayed_user->userdata;
</span><span class="cx">
</span><span class="cx">                         if ( empty( $ud ) ) {
</span><span class="lines">@@ -1137,7 +1138,7 @@
</span><span class="cx">
</span><span class="cx">         if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
</span><span class="cx">                 if ( bp_is_active( 'xprofile' ) ) {
</span><del>-                        $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id );
</del><ins>+                        $fullname = xprofile_get_field_data( $bp->site_options['bp-xprofile-fullname-field-name'], $user_id );
</ins><span class="cx">
</span><span class="cx">                         if ( empty($fullname) ) {
</span><span class="cx">                                 $ud = bp_core_get_core_userdata( $user_id );
</span><span class="lines">@@ -1314,10 +1315,10 @@
</span><span class="cx"> function bp_core_setup_message() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( empty( $bp->template_message ) )
</del><ins>+        if ( empty( $bp->template_message ) && isset( $_COOKIE['bp-message'] ) )
</ins><span class="cx">                 $bp->template_message = $_COOKIE['bp-message'];
</span><span class="cx">
</span><del>-        if ( empty( $bp->template_message_type ) )
</del><ins>+        if ( empty( $bp->template_message_type ) && isset( $_COOKIE['bp-message-type'] ) )
</ins><span class="cx">                 $bp->template_message_type = $_COOKIE['bp-message-type'];
</span><span class="cx">
</span><span class="cx">         add_action( 'template_notices', 'bp_core_render_message' );
</span></span></pre></div>
<a id="trunkbpforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-forums.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-forums.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-forums.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -20,9 +20,11 @@
</span><span class="cx">         $bp->forums->id = 'forums';
</span><span class="cx">
</span><span class="cx">         $bp->forums->image_base = BP_PLUGIN_URL . '/bp-forums/images';
</span><del>-        $bp->forums->bbconfig = $bp->site_options['bb-config-location'];
</del><span class="cx">         $bp->forums->slug = BP_FORUMS_SLUG;
</span><span class="cx">
</span><ins>+        if ( isset( $bp->site_options['bb-config-location'] ) )
+                $bp->forums->bbconfig = $bp->site_options['bb-config-location'];
+
</ins><span class="cx">         /* Register this in the active components array */
</span><span class="cx">         $bp->active_components[$bp->forums->slug] = $bp->forums->id;
</span><span class="cx">
</span><span class="lines">@@ -535,6 +537,9 @@
</span><span class="cx"> function bp_forums_filter_caps( $allcaps ) {
</span><span class="cx">         global $bp, $wp_roles, $bb_table_prefix;
</span><span class="cx">
</span><ins>+        if ( !isset( $bp->loggedin_user->id ) )
+                return $allcaps;
+
</ins><span class="cx">         $bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true );
</span><span class="cx">
</span><span class="cx">         if ( empty( $bb_cap ) )
</span></span></pre></div>
<a id="trunkbpgroupsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-groups.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> function groups_setup_adminbar_menu() {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        if ( !$bp->groups->current_group )
</del><ins>+        if ( empty( $bp->groups->current_group ) )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         /* Don't show this menu to non site admins or if you're viewing your own profile */
</span></span></pre></div>
<a id="trunkbpmessagesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-messages.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-messages.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-messages.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">         $messages_link = $bp->loggedin_user->domain . $bp->messages->slug . '/';
</span><span class="cx">
</span><span class="cx">         /* Add the subnav items to the profile */
</span><del>-        bp_core_new_subnav_item( array( 'name' => __( 'Inbox', 'buddypress' ) . $count_indicator, 'slug' => 'inbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, 'user_has_access' => bp_is_my_profile() ) );
</del><ins>+        bp_core_new_subnav_item( array( 'name' => __( 'Inbox', 'buddypress' ), 'slug' => 'inbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, 'user_has_access' => bp_is_my_profile() ) );
</ins><span class="cx">         bp_core_new_subnav_item( array( 'name' => __( 'Sent Messages', 'buddypress' ), 'slug' => 'sentbox', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_sentbox', 'position' => 20, 'user_has_access' => bp_is_my_profile() ) );
</span><span class="cx">         bp_core_new_subnav_item( array( 'name' => __( 'Compose', 'buddypress' ), 'slug' => 'compose', 'parent_url' => $messages_link, 'parent_slug' => $bp->messages->slug, 'screen_function' => 'messages_screen_compose', 'position' => 30, 'user_has_access' => bp_is_my_profile() ) );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofileclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-classes.php (3356 => 3357)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-classes.php        2010-11-05 21:25:26 UTC (rev 3356)
+++ trunk/bp-xprofile/bp-xprofile-classes.php        2010-11-05 21:37:15 UTC (rev 3357)
</span><span class="lines">@@ -473,7 +473,7 @@
</span><span class="cx">         function get_id_from_name( $field_name ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><span class="cx">
</span><del>-                if ( !$bp->profile->table_name_fields || !$field_name )
</del><ins>+                if ( empty( $bp->profile->table_name_fields ) || !isset( $field_name ) )
</ins><span class="cx">                         return false;
</span><span class="cx">
</span><span class="cx">                 return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) );
</span></span></pre>
</div>
</div>
</body>
</html>