Active
Project:
Drupal for Facebook
Version:
7.x-3.x-dev
Component:
Facebook Connect
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2011 at 21:48 UTC
Updated:
2 Dec 2011 at 20:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
Dave Cohen commentedpossibly the user.mail column is too short to hold the email address.
Comment #2
medden commentedIs there any solution to this problem? where do we find user.mail column ? Do you mean the database table?
Comment #3
luisfn commentedI believe that FB don't return users real e-email.
Comment #4
Dave Cohen commentedIn the past facebook might return a "proxy" address, which was very long, too long to fit into Drupal's users table. And many hosts have mysql configured to not even log an error when it fails to save.
Now, if I understand correctly, facebook do the proxy email anymore, but will return whatever email the user has registered with facebook.
fb_user.module will save the mail if it is available the very first time they register. But once the account is created, it will never add the email address. Try deleting the user account and going through the connect process again, making sure to demand the email extended permission.
Also the new auth dialog might let them deny your app the email address. They constantly change that sort of thing.
Comment #5
medden commentedThanks for the clarification Dave.
I tried deleting the user account and re-registering. Still no joy.
If I look at the new user account as admin, it shows a nice devel block that says:
facebook graph for /******:
Array
( [id] => *******
[name] => My Name
[first_name] => My
[last_name] => Name
[link] => http://www.facebook.com/people/My-Name/******
[gender] => female
[email] => si@medden.co.uk
[locale] => en_US
)
So Facebook is certainly not blocking the email, it's just not getting it at registration time, or not passing it to the new drupal account.
Can anyone confirm if this is working for them?
Comment #6
dmiric commentedI can confirm that its NOT working ;)
Comment #7
jack_tux commentedI CAN confirm that it works for me.
The only change I have done to the base code is at line 680 of fb_user.module
Replaced with
This thread has done it a slightly different way http://drupal.org/node/1117214
Not sure if this is the fix, but I definitely do get the fb email address added to the new user's account.
Comment #8
medden commentedThanks for posting your findings Jack. Good to know a simple fix.
In your opinion would it be better to apply the patch from that link? Or to copy your change?
Comment #9
dimon00 commentedI tried #7 fix but it didn't work for me. :(
Ideas?
Comment #10
Dave Cohen commented#7 is about code in fb_user_user_update(), but this issue is about newly created accounts not containing email. I can't imagine how the two could be related.
It would be more interesting to look at the $info variable in fb_user_create_local_user(). Can you determine whether that array contains an email field?
Comment #11
dimon00 commentedThis is my first time creating a facebook app so I'm not really sure I can be of help (looking into http://drupal.org/node/1117214 as well).
My setting is simple:
- I created an app on facebook,
- I created and app in the fb module setting the parameters ID and Secret,
- I set the app as "Primary connect application",
- Under blocks I enabled the related block (in my case "Facebook Connect Login to CentroVolantini Login"),
- now I can see the connect button,
- I click the button and insert the username and password of a facebook user not yet existing in my drupal,
- connection is fine (but with the last dev version the page is not redirected),
- when I go to the new user details the email is empty.
If you give me instruction I can try to dump the array content.
Comment #12
dimon00 commentedI'm uploading the login form.
It doesn't ask permission to share the email address.
If I enable the develop module in users I can see the array:
facebook graph for /XXXXXX:
Array
(
[id] => XXXXXX
[name] => RXXXX XXXXXXXXo
[first_name] => RXXXX
[last_name] => XXXXXXXXo
[gender] => male
[locale] => en_US
)
I was able to get the email by modifying the facebook login block:
Connect
instead of:
Connect
Comment #13
Dave Cohen commentedThere's two supported ways to request extended permissions.
1) use modules/fb/contrib/fb_permission.module. It adds a fieldset to the app edit form.
2) in your own module, implement hook_fb_required_perms_alter(). You can look over fb_permission_fb_required_perms_alter() as an example.
Comment #14
dimon00 commentedSolution 1 doesn't seem to work.
If I enable email permission as required in contrib/fb_permission.module I get:
"An error occurred with CentroVolantini Login. Please try again later."
If the email is "optional" it is not requested by the authentication form.
Comment #15
Dave Cohen commentedBlame facebook. They include a lot of permissions in their list which don't work and cause that error. Select the other email permission.
Comment #16
imoreno commenteddimon00,
In your application settings, did you enabled the "Email - send me emails (email)" extended permission" as it is working for me with that permission.
Comment #17
dimon00 commentedMy fault.
I used "Give my email address" and not "send me emails".
It is working for me too with "send me emails".
Thank you, imoreno. :)
Comment #18
stano.lacko commentedIn #1278296: Undefined index: email in fb_user_form_alter() is idea for ask for Facebook for users's email.
I think showed idea is working and it's better Idea to have FB connect module better (beacuse admins are looking for problem in module, not in facebook, anyway I don't find any information in documentation for FB module to add this permittion for FB Application).