Skip to:
Content

BuddyPress.org

Changeset 13776


Ignore:
Timestamp:
03/22/2024 08:51:49 AM (2 months ago)
Author:
imath
Message:

Remove the tool to repair the members last activity tracker

In version 2.0 we decided to stop using the last_activity user meta in favor of tracing this information as an activity type having the same name. Meaning we stopped inserting this user meta for new members or any member of a community if the first BuddyPress installed version is upper than 1.9.

When upgrading from a version < 2.0 to the 2.0 version, the bp_last_activity_migrate() function is there to use the user meta to populate the activity table with corresponding last_activity activities.

We also created a repair tool in case the above upgrade task failed. This tool became obsolete but we forgot to remove it. It's now very problematic if an Admin user uses this tool as it will delete all last_activity activities but will fail at finding users having the last_activity meta.

To stop the spread, we decided to remove this tool during a minor release (12.4.0) as we felt it was an emergency.

Props vapvarun

Fixes #9096 (branch 12.0)

Location:
branches/12.0/src/bp-core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/12.0/src/bp-core/admin/bp-core-admin-tools.php

    r13681 r13776  
    111111        __( 'Repair total members count.', 'buddypress' ),
    112112        'bp_admin_repair_count_members',
    113     );
    114 
    115     $repair_list[25] = array(
    116         'bp-last-activity',
    117         __( 'Repair member "last activity" data.', 'buddypress' ),
    118         'bp_admin_repair_last_activity',
    119113    );
    120114
     
    471465    delete_transient( 'bp_active_member_count' );
    472466    bp_core_get_active_member_count();
    473     return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
    474 }
    475 
    476 /**
    477  * Repair user last_activity data.
    478  *
    479  * Re-runs the migration from usermeta introduced in BP 2.0.
    480  *
    481  * @since 2.0.0
    482  */
    483 function bp_admin_repair_last_activity() {
    484     /* translators: %s: the result of the action performed by the repair tool */
    485     $statement = __( 'Determining last activity dates for each user&hellip; %s', 'buddypress' );
    486     bp_last_activity_migrate();
    487467    return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
    488468}
  • branches/12.0/src/bp-core/deprecated/12.0.php

    r13503 r13776  
    16211621    return apply_filters( 'bp_core_get_all_posts_for_user', array( $all_posts ), '12.0.0' );
    16221622}
     1623
     1624/**
     1625 * Repair user last_activity data.
     1626 *
     1627 * Re-runs the migration from usermeta introduced in BP 2.0.
     1628 *
     1629 * @since 2.0.0
     1630 * @deprecated 12.4.0
     1631 */
     1632function bp_admin_repair_last_activity() {
     1633    _deprecated_function( __FUNCTION__, '12.4.0' );
     1634    return array();
     1635}
Note: See TracChangeset for help on using the changeset viewer.