<!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][5431] trunk: Adds WP cache support to groups_get_group() and switches internal instantiations of BP_Groups_Group out for calls to groups_get_group() where possible.</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/5431">5431</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2011-12-01 20:45:38 +0000 (Thu, 01 Dec 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Adds WP cache support to groups_get_group() and switches internal instantiations of BP_Groups_Group out for calls to groups_get_group() where possible. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/3770">#3770</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoreavatarsphp">trunk/bp-core/bp-core-avatars.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsactionsphp">trunk/bp-groups/bp-groups-actions.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsactivityphp">trunk/bp-groups/bp-groups-activity.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsforumsphp">trunk/bp-groups/bp-groups-forums.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsfunctionsphp">trunk/bp-groups/bp-groups-functions.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsnotificationsphp">trunk/bp-groups/bp-groups-notifications.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsscreensphp">trunk/bp-groups/bp-groups-screens.php</a></li>
<li><a href="#trunkbpgroupsbpgroupstemplatephp">trunk/bp-groups/bp-groups-template.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.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 (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-avatars.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-core/bp-core-avatars.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">         if ( 'user' == $object )
</span><span class="cx">                 $item_name = bp_core_get_user_displayname( $item_id );
</span><span class="cx">         elseif ( 'group' == $object )
</span><del>-                $item_name = bp_get_group_name( new BP_Groups_Group( $item_id ) );
</del><ins>+                $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) );
</ins><span class="cx">         elseif ( 'blog' == $object )
</span><span class="cx">                 $item_name = get_blog_option( $item_id, 'blogname' );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-actions.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-actions.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-actions.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         // Set the ID of the new group, if it has already been created in a previous step
</span><span class="cx">         if ( isset( $_COOKIE['bp_new_group_id'] ) ) {
</span><span class="cx">                 $bp->groups->new_group_id = $_COOKIE['bp_new_group_id'];
</span><del>-                $bp->groups->current_group = new BP_Groups_Group( $bp->groups->new_group_id );
</del><ins>+                $bp->groups->current_group = groups_get_group( array( 'group_id' => $bp->groups->new_group_id ) );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // If the save, upload or skip button is hit, lets calculate what we need to save
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsactivityphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-activity.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-activity.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-activity.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">                         $group_id = $secondary_item_id;
</span><span class="cx">                         $requesting_user_id = $item_id;
</span><span class="cx">
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         // Set up the string and the filter
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">                 case 'membership_request_accepted':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx">
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         if ( (int)$total_items > 1 ) {
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">                 case 'membership_request_rejected':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx">
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         if ( (int)$total_items > 1 ) {
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">                 case 'member_promoted_to_admin':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx">
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         if ( (int)$total_items > 1 ) {
</span><span class="lines">@@ -231,7 +231,7 @@
</span><span class="cx">                 case 'member_promoted_to_mod':
</span><span class="cx">                         $group_id = $item_id;
</span><span class="cx">
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         if ( (int)$total_items > 1 ) {
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx">
</span><span class="cx">                 case 'group_invite':
</span><span class="cx">                         $group_id = $item_id;
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">                         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">
</span><span class="cx">                         $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1';
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-classes.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -119,6 +119,8 @@
</span><span class="cx">                         $this->id = $wpdb->insert_id;
</span><span class="cx">
</span><span class="cx">                 do_action_ref_array( 'groups_group_after_save', array( &$this ) );
</span><ins>+                
+                wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
</ins><span class="cx">
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="lines">@@ -141,6 +143,8 @@
</span><span class="cx">
</span><span class="cx">                 do_action_ref_array( 'bp_groups_delete_group', array( &$this ) );
</span><span class="cx">
</span><ins>+                wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' );
+
</ins><span class="cx">                 // Finally remove the group entry from the DB
</span><span class="cx">                 if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) )
</span><span class="cx">                         return false;
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsforumsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-forums.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-forums.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-forums.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> */
</span><span class="cx"> function groups_update_group_forum( $group_id ) {
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">         /**
</span><span class="cx">          * Bail in the following three situations:
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-functions.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-functions.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-functions.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -23,6 +23,16 @@
</span><span class="cx">         return (bool) !empty( $bp->pages->groups->id );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Pulls up the database object corresponding to a group
+ *
+ * When calling up a group object, you should always use this function instead
+ * of instantiating BP_Groups_Group directly, so that you will inherit cache
+ * support and pass through the groups_get_group filter.
+ *
+ * @param $args The load_users parameter is deprecated and does nothing.
+ * @return obj $group The group object
+ */
</ins><span class="cx"> function groups_get_group( $args = '' ) {
</span><span class="cx">         $defaults = array(
</span><span class="cx">                 'group_id' => false,
</span><span class="lines">@@ -31,8 +41,15 @@
</span><span class="cx">
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="cx">         extract( $args, EXTR_SKIP );
</span><ins>+        
+        $cache_key = 'bp_groups_group_' . $group_id . ( $load_users ? '_load_users' : '_noload_users' );
+        
+        if ( !$group = wp_cache_get( $cache_key, 'bp' ) ) {
+                $group = new BP_Groups_Group( $group_id, true, $load_users );
+                wp_cache_set( $cache_key, $group, 'bp' );
+        }
</ins><span class="cx">
</span><del>-        return apply_filters( 'groups_get_group', new BP_Groups_Group( $group_id, true, $load_users ) );
</del><ins>+        return apply_filters( 'groups_get_group', $group );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /*** Group Creation, Editing & Deletion *****************************************/
</span><span class="lines">@@ -55,7 +72,7 @@
</span><span class="cx">          */
</span><span class="cx">
</span><span class="cx">         if ( isset( $group_id ) && $group_id )
</span><del>-                $group = new BP_Groups_Group( $group_id );
</del><ins>+                $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         else
</span><span class="cx">                 $group = new BP_Groups_Group;
</span><span class="cx">
</span><span class="lines">@@ -117,7 +134,7 @@
</span><span class="cx">         if ( empty( $group_name ) || empty( $group_desc ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         $group->name = $group_name;
</span><span class="cx">         $group->description = $group_desc;
</span><span class="cx">
</span><span class="lines">@@ -136,7 +153,7 @@
</span><span class="cx"> function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status = false ) {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         $group->enable_forum = $enable_forum;
</span><span class="cx">
</span><span class="cx">         /***
</span><span class="lines">@@ -184,7 +201,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         // Get the group object
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         if ( !$group->delete() )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="lines">@@ -237,7 +254,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function groups_get_slug( $group_id ) {
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         return $group->slug;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -315,7 +332,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id )
</span><del>-                $group = new BP_Groups_Group( $group_id );
</del><ins>+                $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         else
</span><span class="cx">                 $group = $bp->groups->current_group;
</span><span class="cx">
</span><span class="lines">@@ -503,7 +520,7 @@
</span><span class="cx">         if ( empty( $content ) || !strlen( trim( $content ) ) || empty( $user_id ) || empty( $group_id ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $bp->groups->current_group = new BP_Groups_Group( $group_id );
</del><ins>+        $bp->groups->current_group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">         // Be sure the user is a member of the group before posting.
</span><span class="cx">         if ( !bp_current_user_can( 'bp_moderate' ) && !groups_is_user_member( $user_id, $group_id ) )
</span><span class="lines">@@ -637,7 +654,7 @@
</span><span class="cx">
</span><span class="cx">         // Send friend invites.
</span><span class="cx">         $invited_users = groups_get_invites_for_group( $user_id, $group_id );
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">         for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) {
</span><span class="cx">                 $member = new BP_Groups_Member( $invited_users[$i], $group_id );
</span><span class="lines">@@ -803,7 +820,7 @@
</span><span class="cx">         groups_update_groupmeta( $membership->group_id, 'total_member_count', (int) groups_get_groupmeta( $membership->group_id, 'total_member_count') + 1 );
</span><span class="cx">
</span><span class="cx">         // Record this in activity streams
</span><del>-        $group = new BP_Groups_Group( $membership->group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $membership->group_id ) );
</ins><span class="cx">
</span><span class="cx">         groups_record_activity( array(
</span><span class="cx">                 'action' => apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $membership->user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $membership->user_id, &$group ) ),
</span><span class="lines">@@ -963,4 +980,4 @@
</span><span class="cx"> add_action( 'delete_user', 'groups_remove_data_for_user' );
</span><span class="cx"> add_action( 'bp_make_spam_user', 'groups_remove_data_for_user' );
</span><span class="cx">
</span><del>-?>
</del><span class="cx">\ No newline at end of file
</span><ins>+?>
</ins></span></pre></div>
<a id="trunkbpgroupsbpgroupsnotificationsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-notifications.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-notifications.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-notifications.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> function groups_notification_group_updated( $group_id ) {
</span><span class="cx">         global $bp;
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES );
</span><span class="cx">         $subject = '[' . $sitename . '] ' . __( 'Group Details Updated', 'buddypress' );
</span><span class="cx">
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">         $ud = bp_core_get_core_userdata($admin_id);
</span><span class="cx">         $requesting_ud = bp_core_get_core_userdata($requesting_user_id);
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         if ( 'no' == bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">         $ud = bp_core_get_core_userdata($requesting_user_id);
</span><span class="cx">
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">         if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $group = new BP_Groups_Group( $group_id );
</del><ins>+        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">         $ud = bp_core_get_core_userdata($user_id);
</span><span class="cx">         $group_link = bp_get_group_permalink( $group );
</span><span class="cx">         $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsscreensphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-screens.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-screens.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-screens.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">                         bp_core_add_message( __('Group invite accepted', 'buddypress') );
</span><span class="cx">
</span><span class="cx">                         // Record this in activity streams
</span><del>-                        $group = new BP_Groups_Group( $group_id );
</del><ins>+                        $group = groups_get_group( array( 'group_id' => $group_id ) );
</ins><span class="cx">
</span><span class="cx">                         groups_record_activity( array(
</span><span class="cx">                                 'action' => apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), bp_loggedin_user_id(), &$group ) ),
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupstemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-template.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-template.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-groups/bp-groups-template.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">                 $this->group = $this->next_group();
</span><span class="cx">
</span><span class="cx">                 if ( $this->single_group )
</span><del>-                        $this->group = new BP_Groups_Group( $this->group->group_id );
</del><ins>+                        $this->group = groups_get_group( array( 'group_id' => $this->group->group_id ) );
</ins><span class="cx">
</span><span class="cx">                 if ( 0 == $this->current_group ) // loop has just started
</span><span class="cx">                         do_action('group_loop_start');
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (5430 => 5431)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2011-12-01 18:31:09 UTC (rev 5430)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2011-12-01 20:45:38 UTC (rev 5431)
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">         if ( groups_is_user_banned( bp_loggedin_user_id(), $_POST['gid'] ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        if ( !$group = new BP_Groups_Group( $_POST['gid'], false, false ) )
</del><ins>+        if ( !$group = groups_get_group( array( 'group_id' => $_POST['gid'] ) ) )
</ins><span class="cx">                 return false;
</span><span class="cx">
</span><span class="cx">         if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
</span></span></pre>
</div>
</div>
</body>
</html>