- Affected version
- 1.1.0
PHP:
return $this->sourceDb->fetchAll($this->prepareImportSql($this->prefix, "
SELECT * FROM forumpermission
"));
This does not enforce any order on the forums, so it can happen that non top-level-forums are the first ones being returned.
So when building the node tree, thos forums will be the first ones being processed and thus be the first ones to start the tree
PHP:
protected function prepareForumTree(array $forums)
{
$forumTree = [];
foreach ($forums AS $forumId => $forum)
{
$forumTree[$forum['parentid']][$forumId] = $forum;
}
return $forumTree;
}
When the tree is finally being processed, the parent node of teh first forum will be the first node being imported
PHP:
$oldParentId = array_keys($forumTree)[0];
$state->imported += $this->importNodeTree($forumTree, $forumPermissions, $oldParentId, $stepConfig['parent_node_id']);
So at this point, the parent node does not exist in XF yet causing the forum to be incorrectly imported with no parent at all.