<!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' ) && 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( &$activity ) );
-?>
</del><ins>+        do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
</ins><span class="cx">
</span><span class="cx">         <div class="wrap">
</span><span class="cx">                 <?php screen_icon( 'buddypress-activity' ); ?>
</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 );
-?>
</del><ins>+        natsort( $actions ); ?>
</ins><span class="cx">
</span><span class="cx">         <select name="bp-activities-type">
</span><span class="cx">                 <?php foreach ( $actions as $k => $v ) : ?>
</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 < $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->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 );
-?>
</del><ins>+        do_action( 'bp_activity_admin_index', $messages ); ?>
</ins><span class="cx">
</span><span class="cx">         <div class="wrap">
</span><span class="cx">                 <?php screen_icon( 'buddypress-activity' ); ?>
</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. "All", "Pending", "Approved", "Spam"...
</span><span class="cx">          *
</span><span class="lines">@@ -1066,8 +1070,7 @@
</span><span class="cx">         function display() {
</span><span class="cx">                 extract( $this->_args );
</span><span class="cx">
</span><del>-                $this->display_tablenav( 'top' );
-        ?>
</del><ins>+                $this->display_tablenav( 'top' ); ?>
</ins><span class="cx">
</span><span class="cx">                 <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
</span><span class="cx">                         <thead>
</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="alternate"' : '' );
</del><span class="cx">
</span><ins>+                if ( empty( $row_class ) ) {
+                        $row_class = ' class="alternate"';
+                } else {
+                        $row_class = '';
+                }
+
</ins><span class="cx">                 echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['item_id'] ) . '">';
</span><span class="cx">                 echo $this->single_row_columns( $item );
</span><span class="cx">                 echo '</tr>';
</span><span class="lines">@@ -1288,10 +1296,11 @@
</span><span class="cx">                 echo '</div>';
</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->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' ) && 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->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'] ); ?>
</ins><span class="cx">
</span><del>-        ?>
-
</del><span class="cx">         <div class="wrap">
</span><span class="cx">                 <?php screen_icon( 'buddypress-groups' ); ?>
</span><span class="cx">                 <h2><?php _e( 'Delete Groups', 'buddypress' ) ?></h2>
</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="alternate"' : '';
</del><ins>+                        $row_class = ' class="alternate"';
+                } else {
+                        $row_class = '';
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">';
</span></span></pre>
</div>
</div>
</body>
</html>