Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/08/2017 01:37:58 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Tools: Change BuddyPress group forum repair into an upgrade routine.

This is only intended as a migration path from bbPress 1.x to 2.x, not to be rerun multiple times to force-recount the meta values & private/hidden options.

See #2829.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/tools.php

    r6438 r6496  
    171171    ) );
    172172
    173     // Sync all BuddyPress group forum relationships
    174     bbp_register_repair_tool( array(
    175         'id'          => 'bbp-group-forums',
    176         'type'        => 'repair',
    177         'description' => __( 'Repair BuddyPress Group Forum relationships', 'bbpress' ),
    178         'callback'    => 'bbp_admin_repair_group_forum_relationship',
    179         'priority'    => 35,
    180         'overhead'    => 'low',
    181         'components'  => array( bbp_get_forum_post_type() )
    182     ) );
    183 
    184173    // Update closed topic counts
    185174    bbp_register_repair_tool( array(
     
    188177        'description' => __( 'Repair closed topics', 'bbpress' ),
    189178        'callback'    => 'bbp_admin_repair_closed_topics',
    190         'priority'    => 40,
     179        'priority'    => 35,
    191180        'overhead'    => 'medium',
    192181        'components'  => array( bbp_get_topic_post_type() )
     
    199188        'description' => __( 'Recount topics in each forum', 'bbpress' ),
    200189        'callback'    => 'bbp_admin_repair_forum_topic_count',
    201         'priority'    => 45,
     190        'priority'    => 40,
    202191        'overhead'    => 'medium',
    203192        'components'  => array( bbp_get_forum_post_type(), bbp_get_topic_post_type() )
     
    210199        'description' => __( 'Recount topics in each topic-tag', 'bbpress' ),
    211200        'callback'    => 'bbp_admin_repair_topic_tag_count',
    212         'priority'    => 50,
     201        'priority'    => 45,
    213202        'overhead'    => 'medium',
    214203        'components'  => array( bbp_get_topic_post_type(), bbp_get_topic_tag_tax_id() )
     
    221210        'description' => __( 'Recount replies in each forum', 'bbpress' ),
    222211        'callback'    => 'bbp_admin_repair_forum_reply_count',
    223         'priority'    => 55,
     212        'priority'    => 50,
    224213        'overhead'    => 'high',
    225214        'components'  => array( bbp_get_forum_post_type(), bbp_get_reply_post_type() )
     
    232221        'description' => __( 'Recount replies in each topic', 'bbpress' ),
    233222        'callback'    => 'bbp_admin_repair_topic_reply_count',
     223        'priority'    => 55,
     224        'overhead'    => 'high',
     225        'components'  => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
     226    ) );
     227
     228    // Count topic engagements
     229    bbp_register_repair_tool( array(
     230        'id'          => 'bbp-topic-engagements',
     231        'type'        => 'repair',
     232        'description' => __( 'Recount engagements in each topic', 'bbpress' ),
     233        'callback'    => 'bbp_admin_repair_topic_voice_count',
    234234        'priority'    => 60,
    235         'overhead'    => 'high',
    236         'components'  => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
    237     ) );
    238 
    239     // Count topic voices
    240     bbp_register_repair_tool( array(
    241         'id'          => 'bbp-topic-voices',
    242         'type'        => 'repair',
    243         'description' => __( 'Recount voices in each topic', 'bbpress' ),
    244         'callback'    => 'bbp_admin_repair_topic_voice_count',
    245         'priority'    => 65,
    246235        'overhead'    => 'high',
    247236        'components'  => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
     
    254243        'description' => __( 'Recount pending, spammed, and trashed replies in each topic', 'bbpress' ),
    255244        'callback'    => 'bbp_admin_repair_topic_hidden_reply_count',
    256         'priority'    => 70,
     245        'priority'    => 65,
    257246        'overhead'    => 'high',
    258247        'components'  => array( bbp_get_topic_post_type(), bbp_get_reply_post_type() )
     
    265254        'description' => __( 'Recount topics for each user', 'bbpress' ),
    266255        'callback'    => 'bbp_admin_repair_user_topic_count',
    267         'priority'    => 75,
     256        'priority'    => 70,
    268257        'overhead'    => 'medium',
    269258        'components'  => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
     
    276265        'description' => __( 'Recount replies for each user', 'bbpress' ),
    277266        'callback'    => 'bbp_admin_repair_user_reply_count',
    278         'priority'    => 80,
     267        'priority'    => 75,
    279268        'overhead'    => 'medium',
    280269        'components'  => array( bbp_get_reply_post_type(), bbp_get_user_rewrite_id() )
     
    287276        'description' => __( 'Remove unpublished topics from user favorites', 'bbpress' ),
    288277        'callback'    => 'bbp_admin_repair_user_favorites',
    289         'priority'    => 85,
     278        'priority'    => 80,
    290279        'overhead'    => 'medium',
    291280        'components'  => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
     
    298287        'description' => __( 'Remove unpublished topics from user subscriptions', 'bbpress' ),
    299288        'callback'    => 'bbp_admin_repair_user_topic_subscriptions',
    300         'priority'    => 90,
     289        'priority'    => 85,
    301290        'overhead'    => 'medium',
    302291        'components'  => array( bbp_get_topic_post_type(), bbp_get_user_rewrite_id() )
     
    309298        'description' => __( 'Remove unpublished forums from user subscriptions', 'bbpress' ),
    310299        'callback'    => 'bbp_admin_repair_user_forum_subscriptions',
    311         'priority'    => 95,
     300        'priority'    => 90,
    312301        'overhead'    => 'medium',
    313302        'components'  => array( bbp_get_forum_post_type(), bbp_get_user_rewrite_id() )
     
    320309        'description' => __( 'Remap existing users to default forum roles', 'bbpress' ),
    321310        'callback'    => 'bbp_admin_repair_user_roles',
    322         'priority'    => 100,
     311        'priority'    => 95,
    323312        'overhead'    => 'low',
    324313        'components'  => array( bbp_get_user_rewrite_id() )
     
    331320        'description' => __( 'Upgrade user favorites', 'bbpress' ),
    332321        'callback'    => 'bbp_admin_upgrade_user_favorites',
    333         'priority'    => 105,
     322        'priority'    => 100,
    334323        'overhead'    => 'high',
    335324        'components'  => array( bbp_get_user_rewrite_id(), bbp_get_user_favorites_rewrite_id() )
     
    342331        'description' => __( 'Upgrade user topic subscriptions', 'bbpress' ),
    343332        'callback'    => 'bbp_admin_upgrade_user_topic_subscriptions',
    344         'priority'    => 110,
     333        'priority'    => 105,
    345334        'overhead'    => 'high',
    346335        'components'  => array( bbp_get_user_rewrite_id(), bbp_get_user_subscriptions_rewrite_id() )
     
    353342        'description' => __( 'Upgrade user forum subscriptions', 'bbpress' ),
    354343        'callback'    => 'bbp_admin_upgrade_user_forum_subscriptions',
    355         'priority'    => 115,
     344        'priority'    => 110,
    356345        'overhead'    => 'high',
    357346        'components'  => array( bbp_get_user_rewrite_id(), bbp_get_user_subscriptions_rewrite_id() )
     
    364353        'description' => __( 'Upgrade topic engagements', 'bbpress' ),
    365354        'callback'    => 'bbp_admin_upgrade_user_engagements',
     355        'priority'    => 115,
     356        'overhead'    => 'medium',
     357        'components'  => array( bbp_get_user_rewrite_id(), bbp_get_user_engagements_rewrite_id() )
     358    ) );
     359
     360    // Sync all BuddyPress group forum relationships
     361    bbp_register_repair_tool( array(
     362        'id'          => 'bbp-group-forums',
     363        'type'        => 'upgrade',
     364        'description' => __( 'Upgrade BuddyPress Group Forum relationships', 'bbpress' ),
     365        'callback'    => 'bbp_admin_upgrade_group_forum_relationship',
    366366        'priority'    => 120,
    367         'overhead'    => 'medium',
    368         'components'  => array( bbp_get_user_rewrite_id(), bbp_get_user_engagements_rewrite_id() )
     367        'overhead'    => 'low',
     368        'components'  => array( bbp_get_forum_post_type() )
    369369    ) );
    370370
Note: See TracChangeset for help on using the changeset viewer.