I experienced some issues with the username generator, when the users that register from facebook have the same name as one of the users from the site. To solve that, I just replaced in the _fbconnect_get_username() function this code:

$query = "SELECT COUNT(name) FROM {users} WHERE name = ':user_name'";
$result = db_query($query, array('user_name' => $name_suggestion))->fetchField();
 if ($result['name'] != 0) {

with this:

$result = db_select('users')->fields('users', array('name'))->condition('name', db_like($name_suggestion), 'LIKE')->range(0, 1)->execute()->fetchField();
if ($result) {

and it worked good after.

Comments

ovi.indrei’s picture

Status: Active » Closed (duplicate)