Skip to:
Content

bbPress.org

Changeset 5537


Ignore:
Timestamp:
09/25/2014 05:59:42 AM (12 years ago)
Author:
netweb
Message:

Vanilla2 importer improvements:

  • Don't import Vanilla 2's deleted topic or replies as both topic and reply content is deleted resulting in fragmented topic context
  • Use callback_topicid_to_forumid to convert replies parent topic id to forum id eliminating a SQL join improving performance.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converters/Vanilla.php

    r5535 r5537  
    153153
    154154        // Old topic id (Stored in postmeta)
    155         $this->field_map[] = array(
    156             'from_tablename' => 'Discussion',
    157             'from_fieldname' => 'DiscussionID',
    158             'to_type'        => 'topic',
    159             'to_fieldname'   => '_bbp_old_topic_id'
     155        // Don't import Vanilla 2's deleted topics
     156        $this->field_map[] = array(
     157            'from_tablename'  => 'Discussion',
     158            'from_fieldname'  => 'DiscussionID',
     159            'from_expression' => 'WHERE Format != "Deleted"',
     160            'to_type'         => 'topic',
     161            'to_fieldname'    => '_bbp_old_topic_id'
    160162        );
    161163
     
    322324
    323325        // Old reply id (Stored in postmeta)
     326        // Don't import Vanilla 2's deleted replies
    324327        $this->field_map[] = array(
    325328            'from_tablename'  => 'Comment',
    326329            'from_fieldname'  => 'CommentID',
     330            'from_expression' => 'WHERE Format != "Deleted"',
    327331            'to_type'         => 'reply',
    328332            'to_fieldname'    => '_bbp_old_reply_id'
     
    340344        // Reply parent forum id (If no parent, then 0. Stored in postmeta)
    341345        $this->field_map[] = array(
    342             'from_tablename'  => 'Discussion',
    343             'from_fieldname'  => 'CategoryID',
    344             'join_tablename'  => 'Comment',
    345             'join_type'       => 'INNER',
    346             'join_expression' => 'USING (DiscussionID)',
     346            'from_tablename'  => 'Comment',
     347            'from_fieldname'  => 'DiscussionID',
    347348            'to_type'         => 'reply',
    348349            'to_fieldname'    => '_bbp_forum_id',
    349             'callback_method' => 'callback_forumid'
     350            'callback_method' => 'callback_topicid_to_forumid'
    350351        );
    351352
Note: See TracChangeset for help on using the changeset viewer.