Marcel
Active member
PHP:
$mover = \XF::app()->service('XF:Thread\Mover', $thread);
if ($forum->ut_archive_prefix_id)
{
$mover->setPrefix($forum->ut_archive_prefix_id);
}
else if ($destinationForum->default_prefix_id)
{
$mover->setPrefix($destinationForum->default_prefix_id);
}
$mover->move($destinationForum);
Pseudo : If current forum has ut_archive_prefix_id set...then use that
If not, then check if the destination has a default prefix_id. If so, use that.
If not...then leave as is and move the thread.
The relevant fields are all set, it just moves the thread with no prefix at all.