Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Some replies are attached to a nonexistent parent. In this case, prom…
Browse files Browse the repository at this point in the history
…ote them as Topics.
  • Loading branch information
kdeldycke committed Apr 26, 2011
1 parent 7ee6bee commit 1d2bcc1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion e107-importer.php
Expand Up @@ -1091,10 +1091,11 @@ function import_forum_thread($thread) {

// Top message of threads are topics, attached to a forum.
// Others are replies, attached to a topic.
if ($thread_parent > 0) {
if ($thread_parent > 0 and array_key_exists($thread_parent, $this->forum_post_mapping)) {
$post_type_id = bbp_get_reply_post_type();
$thread_parent_id = (int) $this->forum_post_mapping[$thread_parent];
} else {
$thread_parent = 0; // Reply attached to a nonexistent parent are promoted to topic.
$post_type_id = bbp_get_topic_post_type();
$thread_parent_id = $this->forum_mapping[$thread_forum_id];
}
Expand Down

0 comments on commit 1d2bcc1

Please sign in to comment.