Skip to:
Content

BuddyPress.org

Ticket #6720: 6720.diff

File 6720.diff, 2.1 KB (added by Mamaduka, 9 years ago)
  • src/bp-activity/classes/class-bp-activity-activity.php

    diff --git src/bp-activity/classes/class-bp-activity-activity.php src/bp-activity/classes/class-bp-activity-activity.php
    index 7c879d6..629c439 100644
    class BP_Activity_Activity { 
    528528                                $pag_sql    = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
    529529
    530530                                /** This filter is documented in bp-activity/bp-activity-classes.php */
    531                                 $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
     531                                $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
    532532                        } else {
    533533                                $pag_sql    = '';
    534534
    class BP_Activity_Activity { 
    543543                                 * @param string $where_sql  Final WHERE MySQL statement portion for legacy query.
    544544                                 * @param string $sort       Final sort direction for legacy query.
    545545                                 */
    546                                 $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
     546                                $activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
    547547                        }
    548548
    549549                } else {
    550550                        // Query first for activity IDs.
    551                         $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}";
     551                        $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort}";
    552552
    553553                        if ( ! empty( $per_page ) && ! empty( $page ) ) {
    554554                                // We query for $per_page + 1 items in order to