The Facebook Developer Wiki states that the user ID is a 64-bit int datatype, so it can contain up to 20 decimal digits. As of now, the fbconnect_users table allocates only 10. This causes module malfunction with symptoms like the "Invalid Facebook session, you're not authorized to modify the parameters." message on the Facebook connect tab of affected users' profiles.

The attached patches fix this issue by making the fbuid field an unsigned bigint. This is not enough, however, for 32-bit server systems, as database queries like the one below won't work:

  $result = db_query("SELECT * FROM {fbconnect_users} WHERE fbuid = %d", $fbuid);

The thing is that the above code typecasts $fbuid from string to int before formatting it according to %d. This gets an $fbuid containing more than 10 digits truncated since an int is only 32 bits (10 decimal digits) long on 32-bit servers. Hence the desired row cannot be retrieved from the database.

Long story short, I'm passing the $fbuid to MySQL as string thereby making MySQL do the string to int conversion, not PHP:

  $result = db_query("SELECT uid FROM {fbconnect_users} WHERE fbuid = '%s'", $fbuid);

This patch is sponsored by RockPeaks, to which you are now welcome to login via your Facebook account - long user ID or not!

Comments

EvanDonovan’s picture

Can you roll a version of this patch for 6.x-1.0-beta8? The patch provided above does not apply, although I believe I was able to make the analogous changes.

vectoroc’s picture

Status: Needs review » Closed (fixed)