Closed (fixed)
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2009 at 19:47 UTC
Updated:
30 Dec 2009 at 23:30 UTC
I wrote a module that shall set the local drupal username upon registration to the facebook name. I used the fb hook Operation FB_OP_PRE_USER and this code
# Implementation of Hook Facebook
function npfb_fb($op, &$data, $ret) {
if ($op == FB_OP_PRE_USER) {
$ret['username'] = $ret['info']['name'] . 'blabla';
$ret['mail'] = 'someone@somewhere.con';
return $ret;
}
if ($op == FB_OP_POST_USER) {
npfb_init_fb_user($data[account]); # do various init works
}
}
The user is created but the username is always blank also I return some value (at least the username should be blabla. The problems seems to be in the function fb_user_create_local_user but I cant figure it out. The username is always blank, I would suggest that the username by default is the facebook real persons name.
Comments
Comment #1
scoorch commentedOh and I have read the readme.txt from start to bottom ;-)
Comment #2
Dave Cohen commentedThat's not how hook_fb() works. It's not well documented...
Put the "&" in front of $ret...
And there's no need to
return $ret;. Just modify it.