Fixed New user conversation doesn't allow only one participant?

Liam W

in memoriam 1998-2020
I'm trying to setup the new user conversation feature, but I keep on getting the 'Please enter at least one valid recipient.' error when saving.

I've entered my username in the recipient box, as I want to be the sender and noone else needs to participate.

If I add another user, it works fine.

Liam
 
Fixed now, thanks.

Relatively straight forward self-fix.

library/XenForo/Option/RegistrationWelcome.php:

PHP:
if ($conversationDw->hasErrors())
{
    $errors = $conversationDw->getErrors();
    $dw->error(reset($errors), $fieldName);
    return false;
}

Change that to:
PHP:
if ($conversationDw->hasErrors())
{
    $errors = $conversationDw->getErrors();

    if (isset($errors['recipients']))
    {
        unset($errors['recipients']);
    }

    if (count($errors))
    {
        $dw->error(reset($errors), $fieldName);
        return false;
    }
}
 
Back
Top Bottom