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
32 stars 33 forks source link

Handle orphaned data #197

Open JN-Jones opened 8 years ago

JN-Jones commented 8 years ago

We already had an issue with orphaned attachment and while writing the vb5 module I had the same issue with posts. As a simple solution is possible for nearly all modules it should be added. After the prepare_insert_array (also after the log call) simply add

        // An orphaned post which isn't associated with any thread. We can't handle those for several reasons so trick them
        if($insert_array['tid'] < 1)
        {
            $this->increment_tracker('posts');
            $output->print_progress('end');
            return 0;
        }

Ofc modified for the module (tid and posts replaced with the correct variables)