Duplicate Batch Update Users silently fails to save

DragonByte Tech

Well-known member
Affected version
2.2.12
When attempting to batch update users, any and all changes are completely discarded. This is because there's a silent exception being thrown that is being suppressed; "Please enter a custom title that does not contain any censored words."

Root problem (\XF\Job\UserAction#L143-147):
PHP:
        $customTitle = $this->getActionValue('custom_title');
        if ($customTitle !== '')
        {
            $user->custom_title = $customTitle;
        }
$customTitle in this case is NULL, which causes this block of code (\XF\Entity\User#L1511-1515):
PHP:
        if ($title !== $this->app()->stringFormatter()->censorText($title))
        {
            $this->error(\XF::phrase('please_enter_custom_title_that_does_not_contain_any_censored_words'), 'custom_title');
            return false;
        }
to fail the comparison, as it's comparing NULL to "" (an empty string) using strong type checking.

This was tested with all add-ons disabled.
 
This has already been reported and fixed for the next release.

 
Top Bottom