Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/20/2014 06:06:08 AM (10 years ago)
Author:
netweb
Message:

Converter import user meta data improvements and fixes:

  • Original 'old' user meta key is now defined using _bbp_old_user_id
  • Fixes the "Purge Previous Import" optional removal of previously imported users when using the database sync_table.
  • Updates all included importers with the above changes including the custom callback in e107v1.php

See #2650

File:
1 edited

Legend:

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

    r5527 r5530  
    12411241
    12421242        if ( true === $this->sync_table ) {
    1243             $query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->users . ' ON(value_id = ID) WHERE meta_key = "_bbp_user_id" AND value_type = "user" LIMIT ' . $this->max_rows;
     1243            $query = 'SELECT value_id FROM ' . $this->sync_table_name . ' INNER JOIN ' . $this->wpdb->users . ' ON(value_id = ID) WHERE meta_key = "_bbp_old_user_id" AND value_type = "user" LIMIT ' . $this->max_rows;
    12441244        } else {
    1245             $query = 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" LIMIT ' . $this->max_rows;
     1245            $query = 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_old_user_id" LIMIT ' . $this->max_rows;
    12461246        }
    12471247
     
    14311431        if ( !isset( $this->map_userid[$field] ) ) {
    14321432            if ( !empty( $this->sync_table ) ) {
    1433                 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
     1433                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
    14341434            } else {
    1435                 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
     1435                $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT user_id AS value_id FROM ' . $this->wpdb->usermeta . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) );
    14361436            }
    14371437
Note: See TracChangeset for help on using the changeset viewer.