Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/13/2014 11:45:17 AM (10 years ago)
Author:
boonebgorges
Message:

Introduce tool on Tools menu for repairing last_activity data

Fixes #5461

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-update.php

    r8119 r8124  
    346346    bp_core_install_activity_streams();
    347347
    348     $bp = buddypress();
    349 
    350348    /** Migrate 'last_activity' data *************************************/
    351349
    352     // The "NOT IN" clause prevents duplicates
    353     $sql = "INSERT INTO {$bp->members->table_name_last_activity} (`user_id`, `component`, `type`, `action`, `content`, `primary_link`, `item_id`, `date_recorded` ) (
    354           SELECT user_id, '{$bp->members->id}' as component, 'last_activity' as type, '' as action, '' as content, '' as primary_link, 0 as item_id, meta_value AS date_recorded
    355           FROM {$wpdb->usermeta}
    356           WHERE
    357             meta_key = 'last_activity'
    358             AND
    359             user_id NOT IN (
    360               SELECT user_id
    361               FROM {$bp->members->table_name_last_activity}
    362               WHERE component = '{$bp->members->id}' AND type = 'last_activity'
    363             )
    364     );";
    365 
    366     $wpdb->query( $sql );
     350    bp_last_activity_migrate();
    367351
    368352    /** Migrate signups data *********************************************/
Note: See TracChangeset for help on using the changeset viewer.