mybb / merge-system

The MyBB Merge System allows for easy merging of an existing forum (be it MyBB or another forum software) into a MyBB 1.8.x forum.
Other
34 stars 33 forks source link

Fix #238 Error on importing sub-forum before its parent's been merged. And code improvement. #239

Closed yuliu closed 3 years ago

yuliu commented 4 years ago

Aims to fix #238 and has minor code improvement.

Since the order of forums to be merged is not consistent across modules, each one should take care of the scenario that in the Converter_Module_Forums a forum is merged before its parent forum can be merged.

The first one to fix is SMF2 module. Other modules are in the examination queue. The checklist is in this comment https://github.com/mybb/merge-system/issues/238#issuecomment-562741207

yuliu commented 4 years ago

This PR is my initial though for the fix. It also could be fixed by having a similar cleanup() function to other converter modules' ones, instead of adding a finish() function, for more elegant coding. However, if the source data may be corrupted, for instance a forum from old database may not have a valid record of its parent forum, running the import_forums converter module may result in SQL query errors.

yuliu commented 4 years ago

Fix could be easier. The column field pid is missing in forums base module..