2008-12-13, 05:13 PM
In SMF 1.1.7, importing forums will sometimes result in an incorrect forum list. The following piece of code is the problem.
(from the import forums function in the smf.php module)
Because SMF splits categories and forums into two separate tables, we import them separately as well; categories first, then forums.
So when we import forums we check ID_PARENT to see if it is a child of a forum or a category. At the end we then have to update our internal caches with the piece of code above.
However, the logic in that code is wrong. We will ALWAYS be importing forums in that module so updating the category cache array can result in incorrect collisions and a bad forum list.
All we need is simply:
(from the import forums function in the smf.php module)
if($forum['ID_PARENT'])
{
$this->import_fids_f[$insert_forum['import_fid']] = $fid;
}
else
{
$this->import_fids_c[$insert_forum['import_fid']] = $fid;
}
Because SMF splits categories and forums into two separate tables, we import them separately as well; categories first, then forums.
So when we import forums we check ID_PARENT to see if it is a child of a forum or a category. At the end we then have to update our internal caches with the piece of code above.
However, the logic in that code is wrong. We will ALWAYS be importing forums in that module so updating the category cache array can result in incorrect collisions and a bad forum list.
All we need is simply:
$this->import_fids_f[$insert_forum['import_fid']] = $fid;