Closed (fixed)
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2009 at 15:31 UTC
Updated:
22 Mar 2010 at 23:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
Dave Cohen commentedI'll keep an eye out for this, but unless you can tell me exactly how to reproduce it I'm not sure how to fix it.
Comment #2
vectoroc commentedFor me logout from second (I'm testing with 2 fb accounts) causes this warning. Can you check how it works with 2+ accounts ?
Comment #3
vectoroc commentedhere is exactly warning message
Comment #4
Dave Cohen commentedOK that helps. I don't think their should be entries with uid=0 in that table.
What are your fb_user settings? Do you have it create new accounts automatically?
Comment #5
vectoroc commentedautomatically for second account
Comment #6
aronmalkine commentedI'm actually getting a similar issue around line 71. Facebook is trying to set the uid value to NULL, but the database is complaining, saying that the uid column does not accept NULL values.
fb_user.install line 27:
fb_user.module line 69:
Seems like a contradiction here... Maybe I don't understand the situation where would you want to set the uid to NULL... especially if you have automatic account creation.
Comment #7
Dave Cohen commentedThis does need to be fixed.
The uid can be null, as users who authorize the app do not necessarily have a local account. So the fix will be to allow null and write an update function to change the db.
Comment #8
Dave Cohen commentedI hope this is the fix.
Comment #9
aronmalkine commentedCan you give me some quick background on why we want to set the uid to NULL? Not understanding that from a FB_Connect site perspective. Wouldn't this dissasociate the facebook account from the drupal user in a sense?
Comment #10
Dave Cohen commentedThere are times when a user is interacting with the site, and the facebook id is known, but there is no local drupal account. I believe there was a time when I just used uid 0 in this case. I can't recall exactly the history of the decision to use NULL. I think it implies an association with no drupal account, rather than with the anonymous account.
The fb_user_app table, where this stuff is stored, is mostly for statistical purposes. It's possible to learn which facebook users have used the app. It also stores their session key which in some cases allows the app to interact with facebook on their behalf even when they are not logged in.
If you have more database know-how than I do, feel free to suggest the best approach for what to store in the uid column when there is no local account.
Comment #11
Dave Cohen commentedMy plan now is to use 0 in the uid field, rather than allow null. Here's a patch to apply instead of the previous one.
Comment #12
Dave Cohen commentedChecked in for inclusion in beta4.