<!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][6609] trunk: Fix issue with activity and group admin bottom bulk actions not working.</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/6609">6609</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-12-10 14:43:06 +0000 (Mon, 10 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix issue with activity and group admin bottom bulk actions not working. Fixes <a href="http://buddypress.trac.wordpress.org/ticket/4547">#4547</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpactivitybpactivityadminphp">trunk/bp-activity/bp-activity-admin.php</a></li>
<li><a href="#trunkbpgroupsbpgroupsadminphp">trunk/bp-groups/bp-groups-admin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpactivitybpactivityadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-activity/bp-activity-admin.php (6608 => 6609)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-activity/bp-activity-admin.php        2012-12-10 14:36:32 UTC (rev 6608)
+++ trunk/bp-activity/bp-activity-admin.php        2012-12-10 14:43:06 UTC (rev 6609)
</span><span class="lines">@@ -168,6 +168,12 @@
</span><span class="cx">         // Decide whether to load the dev version of the CSS and JavaScript
</span><span class="cx">         $min = ( defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ) ? '' : 'min.';
</span><span class="cx"> 
</span><ins>+        // Bottom bulk action hack
+        if ( !empty( $_REQUEST['action2'] ) ) {
+                $_REQUEST['action'] = $_REQUEST['action2'];
+                unset( $_REQUEST['action2'] );
+        }
+
</ins><span class="cx">         // Decide whether to load the index or edit screen
</span><span class="cx">         $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
</span><span class="cx"> 
</span><span class="lines">@@ -532,7 +538,6 @@
</span><span class="cx">  * @since BuddyPress (1.6)
</span><span class="cx">  */
</span><span class="cx"> function bp_activity_admin_edit() {
</span><del>-        global $screen_layout_columns;
</del><span class="cx"> 
</span><span class="cx">         // @todo: Check if user is allowed to edit activity items
</span><span class="cx">         // if ( ! current_user_can( 'bp_edit_activity' ) )
</span><span class="lines">@@ -563,8 +568,7 @@
</span><span class="cx">         $form_url = add_query_arg( 'action', 'save', $form_url );
</span><span class="cx"> 
</span><span class="cx">         // Call an action for plugins to modify the activity before we display the edit form
</span><del>-        do_action_ref_array( 'bp_activity_admin_edit', array( &amp;$activity ) );
-?&gt;
</del><ins>+        do_action_ref_array( 'bp_activity_admin_edit', array( &amp;$activity ) ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx">                 &lt;?php screen_icon( 'buddypress-activity' ); ?&gt;
</span><span class="lines">@@ -730,8 +734,7 @@
</span><span class="cx">         unset( $actions['friends_register_activity_action'] );
</span><span class="cx"> 
</span><span class="cx">         // Sort array by the human-readable value
</span><del>-        natsort( $actions );
-?&gt;
</del><ins>+        natsort( $actions ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;select name=&quot;bp-activities-type&quot;&gt;
</span><span class="cx">                 &lt;?php foreach ( $actions as $k =&gt; $v ) : ?&gt;
</span><span class="lines">@@ -787,8 +790,9 @@
</span><span class="cx"> 
</span><span class="cx">                 // Make sure we don't get any empty values in $errors
</span><span class="cx">                 for ( $i = 0, $errors_count = count( $errors ); $i &lt; $errors_count; $i++ ) {
</span><del>-                        if ( 0 === $errors[$i] )
</del><ins>+                        if ( 0 === $errors[$i] ) {
</ins><span class="cx">                                 unset( $errors[$i] );
</span><ins>+                        }
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 // Reindex array
</span><span class="lines">@@ -830,8 +834,7 @@
</span><span class="cx">         $bp_activity_list_table-&gt;prepare_items();
</span><span class="cx"> 
</span><span class="cx">         // Call an action for plugins to modify the activity before we display the edit form
</span><del>-        do_action( 'bp_activity_admin_index', $messages );
-?&gt;
</del><ins>+        do_action( 'bp_activity_admin_index', $messages ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx">                 &lt;?php screen_icon( 'buddypress-activity' ); ?&gt;
</span><span class="lines">@@ -896,6 +899,7 @@
</span><span class="cx">  * @since BuddyPress (1.6)
</span><span class="cx">  */
</span><span class="cx"> class BP_Activity_List_Table extends WP_List_Table {
</span><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * What type of view is being displayed? e.g. &quot;All&quot;, &quot;Pending&quot;, &quot;Approved&quot;, &quot;Spam&quot;...
</span><span class="cx">          *
</span><span class="lines">@@ -1066,8 +1070,7 @@
</span><span class="cx">         function display() {
</span><span class="cx">                 extract( $this-&gt;_args );
</span><span class="cx"> 
</span><del>-                $this-&gt;display_tablenav( 'top' );
-        ?&gt;
</del><ins>+                $this-&gt;display_tablenav( 'top' ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;table class=&quot;&lt;?php echo implode( ' ', $this-&gt;get_table_classes() ); ?&gt;&quot; cellspacing=&quot;0&quot;&gt;
</span><span class="cx">                         &lt;thead&gt;
</span><span class="lines">@@ -1099,8 +1102,13 @@
</span><span class="cx">          */
</span><span class="cx">         function single_row( $item ) {
</span><span class="cx">                 static $row_class = '';
</span><del>-                $row_class = ( $row_class == '' ? ' class=&quot;alternate&quot;' : '' );
</del><span class="cx"> 
</span><ins>+                if ( empty( $row_class ) ) {
+                        $row_class = ' class=&quot;alternate&quot;';
+                } else {
+                        $row_class = '';
+                }
+
</ins><span class="cx">                 echo '&lt;tr' . $row_class . ' id=&quot;activity-' . esc_attr( $item['id'] ) . '&quot; data-parent_id=&quot;' . esc_attr( $item['id'] ) . '&quot; data-root_id=&quot;' . esc_attr( $item['item_id'] ) . '&quot;&gt;';
</span><span class="cx">                 echo $this-&gt;single_row_columns( $item );
</span><span class="cx">                 echo '&lt;/tr&gt;';
</span><span class="lines">@@ -1288,10 +1296,11 @@
</span><span class="cx">                 echo '&lt;/div&gt;';
</span><span class="cx"> 
</span><span class="cx">                 // Get activity content - if not set, use the action
</span><del>-                if ( ! empty( $item['content'] ) )
</del><ins>+                if ( ! empty( $item['content'] ) ) {
</ins><span class="cx">                         $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) );
</span><del>-                else
</del><ins>+                } else {
</ins><span class="cx">                         $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) );
</span><ins>+                }
</ins><span class="cx"> 
</span><span class="cx">                 echo $content . ' ' . $this-&gt;row_actions( $actions );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkbpgroupsbpgroupsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-admin.php (6608 => 6609)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-admin.php        2012-12-10 14:36:32 UTC (rev 6608)
+++ trunk/bp-groups/bp-groups-admin.php        2012-12-10 14:43:06 UTC (rev 6609)
</span><span class="lines">@@ -56,11 +56,17 @@
</span><span class="cx">         global $bp_groups_list_table;
</span><span class="cx"> 
</span><span class="cx">         // Build redirection URL
</span><del>-        $redirect_to = remove_query_arg( array( 'action', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] );
</del><ins>+        $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] );
</ins><span class="cx"> 
</span><span class="cx">         // Decide whether to load the dev version of the CSS and JavaScript
</span><span class="cx">         $min = defined( 'SCRIPT_DEBUG' ) &amp;&amp; SCRIPT_DEBUG ? '' : 'min.';
</span><span class="cx"> 
</span><ins>+        // Bottom bulk action hack
+        if ( !empty( $_REQUEST['action2'] ) ) {
+                $_REQUEST['action'] = $_REQUEST['action2'];
+                unset( $_REQUEST['action2'] );
+        }
+
</ins><span class="cx">         // Decide whether to load the index or edit screen
</span><span class="cx">         $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
</span><span class="cx"> 
</span><span class="lines">@@ -543,10 +549,8 @@
</span><span class="cx">                 $gids[] = $group-&gt;id;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        $base_url  = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] );
</del><ins>+        $base_url  = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?&gt;
</ins><span class="cx"> 
</span><del>-        ?&gt;
-
</del><span class="cx">         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx">                 &lt;?php screen_icon( 'buddypress-groups' ); ?&gt;
</span><span class="cx">                 &lt;h2&gt;&lt;?php _e( 'Delete Groups', 'buddypress' ) ?&gt;&lt;/h2&gt;
</span><span class="lines">@@ -1087,7 +1091,9 @@
</span><span class="cx">                 static $row_class = '';
</span><span class="cx"> 
</span><span class="cx">                 if ( empty( $row_class ) ) {
</span><del>-                        $row_class = ( $row_class == '' ) ? ' class=&quot;alternate&quot;' : '';
</del><ins>+                        $row_class = ' class=&quot;alternate&quot;';
+                } else {
+                        $row_class = '';
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 echo '&lt;tr' . $row_class . ' id=&quot;activity-' . esc_attr( $item['id'] ) . '&quot; data-parent_id=&quot;' . esc_attr( $item['id'] ) . '&quot; data-root_id=&quot;' . esc_attr( $item['id'] ) . '&quot;&gt;';
</span></span></pre>
</div>
</div>

</body>
</html>