Skip to:
Content

BuddyPress.org

Changeset 8585


Ignore:
Timestamp:
07/10/2014 08:03:48 PM (10 years ago)
Author:
johnjamesjacoby
Message:

In bp_blogs_record_existing_blogs(), switch to using TRUNCATE rather than DELETE to reset the auto-increment value.

  • Move this truncation to after the empty( $blog_ids ) check, to avoid leaving the tables in a misaligned state.
  • Also truncate bp_user_blogmeta to ensure accurate data is recorded.

See #5749.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r8584 r8585  
    7272    global $bp, $wpdb;
    7373
    74     // Truncate user blogs table and re-record.
    75     $wpdb->query( "DELETE FROM {$bp->blogs->table_name} WHERE 1=1" );
    76 
    7774    // Query for all sites in network
    7875    if ( is_multisite() ) {
     
    9693        return;
    9794    }
     95
     96    // Truncate user blogs table and re-record.
     97    $wpdb->query( "TRUNCATE {$bp->blogs->table_name}"          );
     98    $wpdb->query( "TRUNCATE {$bp->blogs->table_name_blogmeta}" );
    9899
    99100    // Loop through users of blogs and record them
Note: See TracChangeset for help on using the changeset viewer.