Closed (duplicate)
Project:
Facebook Connect
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2011 at 12:56 UTC
Updated:
23 Mar 2012 at 00:50 UTC
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
Comment #1
ovi.indrei commentedMarking this as duplicate of #1312100: _fbconnect_get_username() doesn't work.