2011-01-28, 03:35 AM
It appears that usernames that begin with an asterisk (*) cause errors, such as "*Gary". I noticed this on my forum when a member called *Matt sent a PM to me. When I go to Private Messaging -> Sent Items, I get an error saying that there's an error in the SQL query, with the error pointing to ",*Matt,".
Considering that this is a fairly glaring bug, one reason why this happened to me might be because I converted from vBulletin to MyBB a year ago. So maybe vBulletin accepts usernames that begin with * but MyBB doesn't? Could someone tell me?
Anyway, I fixed this for myself temporarily by opening private.php. The line causing the actual error is the second instance of the following code:
A few lines above it, where it says:
I replaced it with the following:
So that all usernames are wrapped in quotes. I'm surprised this hasn't been done already.
Ah, and when I do a little searching for why messages have "N/A (not sent)" in the "Sent to" field, I find this useful thread. So maybe that will help.
And yes, it appears that that thread helped. So, I assume that the problem has since been fixed in the Importer.
Considering that this is a fairly glaring bug, one reason why this happened to me might be because I converted from vBulletin to MyBB a year ago. So maybe vBulletin accepts usernames that begin with * but MyBB doesn't? Could someone tell me?
Anyway, I fixed this for myself temporarily by opening private.php. The line causing the actual error is the second instance of the following code:
$users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})");
A few lines above it, where it says:
$get_users = implode(',', array_unique($get_users));
I replaced it with the following:
$get_users = array_unique($get_users);
$new_get_users = array();
foreach ($get_users as $user)
{
array_push($new_get_users, '"' . $user . '"');
}
$get_users = implode(',', $new_get_users);
So that all usernames are wrapped in quotes. I'm surprised this hasn't been done already.
Ah, and when I do a little searching for why messages have "N/A (not sent)" in the "Sent to" field, I find this useful thread. So maybe that will help.
And yes, it appears that that thread helped. So, I assume that the problem has since been fixed in the Importer.