Hello, i'm currently trying to get the fb_registration.module to work, but it just doesn't want to work, i've set my facebook application as primary and activated the module. It is supposed to be showing the form in the registration page already but it doesn't, so i think i kinda hacked it in my user register page tpl, and i'm printing the form like print_r($page['content']['system_main']['fb_registration']['#value']);
The form prints very well and it lets me log in my facebook account and prefills the fields automatically, but when i click on register, it reloads the same register page but with no registration form and two errors saying that "field is required". It doesn't even especify which field does it means.
I had a drupal normal registration form before, it had some custom fields, i related them to facebook custom fields. But i'm not sure if what i'm doing it's the right way. I really need help on this, i gotta have this finished for my client tomorrow.
Thanks in advance.
Comments
Comment #1
justjuank commentedI think i got it to work a little more, now it registers my user, but not the custom fields.
Something i want to point, correct me if i'm wrong, but there's a line in fb_registration.module that uses the function drupal_execute which was changed in drupal 7 for drupal_form_submit().
Anyways, any ideas how to save my other custom fields?
Comment #2
Dave Cohen commentedSounds like that one hasn't been (fully) upgraded to D7.
Also there are some form elements supported by Drupal that are not supported by facebook registration. If you look through fb_registration.module you'll see how it handles some elements specially. If you have an element type that it is missing, you could submit a patch or write a custom form alter to support it. (Please share your work if you do).
Comment #3
justjuank commentedHi Dave, thanks for your great work with this plugin, i'm still trying to save my custom fields for my users, i've checked the fb_registration.module and how it handles the fields like name and mail, but those are normal fields in the user table, while the custom fields i think they are saved in other table, so i've tried doing the same as in the fb_registration.module, but it just says throws a lot of errors. Is there some special hook for the custom fields?
And sorry i'm not that good for writing a patch or something like that, but if i get to save the custom fields i would be glad to share the code.
Comment #4
Dave Cohen commentedIt's complicated because
a) Drupal forms are complicated.
b) Drupal forms are nested and facebook form is not.
c) Drupal forms support element types which facebook does not.
d) After the facebook form is submitted, the module has to "execute" the drupal form.
Unless you're advanced enough to support your custom elements, I simply recommend not using fb_registration.module. Many sites can get away with just clicking a facebook connect button, instead of (or, in addition to) filling out a form.
Comment #5
justjuank commentedI'm still trying to figure this out.
I just need to save the custom fields i've added to the facebook registration form, for example, the first_name and last_name fields are being automatically filled and i'm associatting them with their respective custom field of the normal drupal form, but when i click on register, they're not being saved. i'm checked the whole fb_registration.module, and the first_name and last_name are being send to the functions in the module, but the problem is that my custom firstname and lastname fields are saved in the database as single tables, like field_data_field_lastname so how could i save the data of those custom fields?
I just need to do this and i'm done, my client wants the registration work that way, so i don't have other choice.
Comment #6
philosurfer commentedbummp!
Comment #7
eidoscomIs this code correct??
or must be:
on line 62 of fb_registration.module
I can't undestand this fragment of code but seems that is not correct for me ...
Comment #8
eidoscomWhen you put this
what is meaning 'name' on the right side of the equal?? is the mapping from facebook or is the machine name of the field??
Comment #9
Dave Cohen commented...is correct. It is both testing $sr['registration'] and setting $registration for later use.
This is understandably confusing. The 'name' on the right is a special word facebook expects to see later. Drupal's normal $form['name'] element will be replaced by facebook's special field also called 'name'.