Batch update users broken in 2.2.12

FTL

Well-known member
For what it's worth, the bulk update worked for me when I deleted Rejected users, ie spammers (no errors) so this is the first I hear of this issue. I know to wait for a fix now though.
 

Pawn Studios

Well-known member
The custom title is not the issue - the actual issue is deeper in the code. Others mentioned commenting out the IF but doing that caused errors. I added the code I did so the script would not fail.

A better solution that seems to work is making a backup of your original, then replace it with an earlier version - I tried 2.2.11 and it worked fine without any code changes except for changing the STATE of the users - I wanted to change the STATE to "bounced email" and that only did the change on about 80 of the 1500 I needed it to.
K a M a L described the issue as $customTitle is never an empty string but instead it gets assigned null which causes the if statement to be faulty as it attempts to filter out empty string as the disallowed value when it should be filtering out null as well which is also equivelant to an empty string in terms of lack of meaningful data.

Therefore combining a null and empty string check should do the trick in this spot.
 

ActorMike

Well-known member
I need to batch-update our users to lock dormant accounts. Hopefully, there will be a fix soon as this is a security issue!

 

Chris D

XenForo developer
Staff member
For now the recommended workaround is as follows.

Edit src/XF/Job/UserAction.php.

Find:
PHP:
$customTitle = $this->getActionValue('custom_title');
if ($customTitle !== '')
{
   $user->custom_title = $customTitle;
}

Replace with:
PHP:
if ($customTitle = $this->getActionValue('custom_title'))
{
   $user->custom_title = $customTitle;
}

This will flag files with unexpected contents which you can ignore for this file until the next release.
 

gotski

Active member
Batch update users also stopped working for me when I try to batch delete users from one secondary group and add to another, before update it used to work fine.
 

htsumer

Active member
That topic is a solution to another problem. My problem is in bulk updates
 
For now the recommended workaround is as follows.

Edit src/XF/Job/UserAction.php.

Find:
PHP:
$customTitle = $this->getActionValue('custom_title');
if ($customTitle !== '')
{
   $user->custom_title = $customTitle;
}

Replace with:
PHP:
if ($customTitle = $this->getActionValue('custom_title'))
{
   $user->custom_title = $customTitle;
}

This will flag files with unexpected contents which you can ignore for this file until the next release.
This would be lovely if I knew what I was doing, and I don't.

This is also causing an issue with our payment add on which adds users to a secondary group upon purchase.

Will this be a fixed anytime soon for the not so technically minded as I won't mind renewing my licence if it is.
 
Top