Skip to:
Content

bbPress.org

Changeset 5527


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

Converter import meta data improvements and fixes:

  • Original 'old' hierarchical/threaded replies meta key is now defined using _bbp_old_reply_to_id
  • Fixes the "Purge Previous Import" optional removal of previously imported hierarchical/threaded replies when using the database sync_table.
  • Updates Drupal7.php importer compatibility for the above changes

See #2650

Location:
trunk/src/includes/admin
Files:
2 edited

Legend:

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

    r5525 r5527  
    10361036                                         *          _bbp_topic_id             // The new topic ID
    10371037                                         *          _bbp_old_reply_id         // The old reply ID
     1038                                         *          _bbp_old_reply_to_id      // The old reply to ID
    10381039                                         */
    10391040                                        if ( '_id' == substr( $key, -3 ) && ( true === $this->sync_table ) ) {
     
    10411042                                        }
    10421043
    1043                                         // Replies need to save their old reply_to ID for hierarchical replies association
    1044                                         if ( ( 'reply' == $to_type ) && ( '_bbp_reply_to' == $key ) ) {
    1045                                             add_post_meta( $post_id, '_bbp_old_reply_to', $value );
     1044                                        /**
     1045                                         * Replies need to save their old reply_to ID for
     1046                                         * hierarchical replies association. Later we update
     1047                                         * the _bbp_reply_to value with the new bbPress
     1048                                         * value using convert_reply_to_parents()
     1049                                         */
     1050                                        if ( ( 'reply' == $to_type ) && ( '_bbp_old_reply_to_id' == $key ) ) {
     1051                                            add_post_meta( $post_id, '_bbp_reply_to', $value );
    10461052                                        }
    10471053                                    }
     
    11871193
    11881194        if ( !empty( $this->sync_table ) ) {
    1189             $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_to" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
     1195            $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_reply_to_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
    11901196        } else {
    1191             $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_reply_to" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
     1197            $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_reply_to_id" AND meta_value > 0 LIMIT ' . $start . ', ' . $this->max_rows;
    11921198        }
    11931199
  • trunk/src/includes/admin/converters/Drupal7.php

    r5526 r5527  
    349349            'from_fieldname'  => 'pid',
    350350            'to_type'         => 'reply',
    351             'to_fieldname'    => '_bbp_reply_to'
     351            'to_fieldname'    => '_bbp_old_reply_to_id'
    352352        );
    353353
Note: See TracChangeset for help on using the changeset viewer.