MyBB Community Forums

Full Version: 1.4.9, MERGE USER gets SQL errror with postgresql
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
when I attempt to merge users in MyBB 1.4.9, PHP 5.2.9, pgsql 8.3.7, I'm getting the following error:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
22P02 - ERROR: invalid input syntax for integer: ""
Query:
UPDATE mybb_users SET reputation='' WHERE uid='34'
Extra:

looks to -me- like the error is in admin/modules/user/users.php line 1525-1527,

$total_reputation = $db->fetch_field($query, "total_rep");

$db->update_query("users", array('reputation' => $total_reputation), "uid='{$destination_user['uid']}'");

and adding htis line in the middle seems to fix it.
 if($total_reputation == '') $total_reputation='0';


I'd have filed this as a bug report, but I can't seem to get authenticated on the new bug reporter.

Note, my forum doesn't use reputations at all, so I dunno if '0' is the right value for 'none'.
I could have sworn this has been reported before but I can't find it on the Dev site, maybe I'm getting it confused with something else.

I'd assume it is a bug though so I can report it as a bug for you if you're having trouble with the reporter, I'd just link to this thread.
I think I may have reported it with an earlier 1.4.x build, before the current bug tracker was in place of the bug forum... and I hacked a similar fix in the previous one, because I know I've merged a couple users before...
I'm assuming this will also affect MySQL Strict mode. I'll add it to the bug tracker.