We do have several custom importers for forum systems like WBB, UBB, etc. and also for Add-ons like the popular "Post Thanks" for vBulletin.
If appropriate, those importers also have code to import data that can be transformed into Like reactions, for example
This code does work just fine on XF 2.0, but does fail on XF 2.1 due to field
Of course I could just change the code to use
Does anyone know how to do that?
Or maybe @Chris D or @Mike could give some feedback on this?
If appropriate, those importers also have code to import data that can be transformed into Like reactions, for example
PHP:
/** @var \XF\Import\Data\LikedContent $import */
$import = $this->newHandler('XF:LikedContent');
$import->preventRetainIds();
$import->bulkSet([
'content_type' => 'post',
'content_id' => $newContentId,
'content_user_id' => $newContentUserId,
'like_user_id' => $newLikeUserId,
'like_date' => $thank['dateline'],
'is_counted' => 1,
]);
if ($newId = $import->save($oldId))
{
$state->imported++;
}
This code does work just fine on XF 2.0, but does fail on XF 2.1 due to field
reaction_user_id
not being set.Of course I could just change the code to use
XF:ReactionContent
instead, but I'd really like to know how to make this existing code work properly with XF 2.1 XF:LikedContent
apparently still being supported as it got bugfixes for XF 2.1.Does anyone know how to do that?
Or maybe @Chris D or @Mike could give some feedback on this?