SychO9/flarum-move-posts

Unable to move posts for deleted users

Opened this issue · 0 comments

When the poster has deleted their account, an error is generated in http request and the button continues to spin:

image

It's related to this line:

MovePostsHandler.php

/**
 * Creates a target discussion when specified.
 */
protected function createTargetDiscussion(Discussion $sourceDiscussion, CommentPost $firstPost, string $title, bool $emulate): Discussion
{
    $discussion = Discussion::start($title, $firstPost->user);

When starting the discussion it appears an actual User is required, but the user of the post deleted their account. Maybe it needs to support Guest user of some kind here?