createRedirectionRecordForThread node_id/saveNow arguments are not correctly used

Xon

Well-known member
Affected version
2.2.7 Patch 1
PHP:
public function createRedirectionRecordForThread(\XF\Entity\Thread $thread, \XF\Entity\Thread $targetThread, $expiryLength = 0, $nodeId = null, $saveNow = true)

createRedirectionRecordForThread doesn't actually do anything with the $nodeId argument;

PHP:
$nodeId = intval($nodeId);
if (!$nodeId)
{
   $thread->node_id;
}

And createRedirectionRecordForThread is incorrectly called inside XF\Service\Thread\Merger::convertSourcesToRedirects as;
PHP:
$redirectRepo->createRedirectionRecordForThread($sourceThread, $target, $this->redirectLength, false);

Passing false to an int $nodeId param instead of the bool $saveNow param (which is redundant anyway)
 
I'm wondering if cleanUpThreadRedirectionDouble unset prefix_id as well. Since if the user sets a new prefix, this is the value which is copied onto the the redirection thread which may not be usable in the old forum.
 
Top Bottom