This is my first use of this module, and from looking over prior issues, it seems like it should be possible to have the connect button on the user login form. But I cannot see how this happens. I noticed code in the hook_form_alter() code of previous versions that adds the button.
I looked at the change history and see that these changes broke it:
commit 7c1d439e717d7219b4907796781be76775b5ad82
Author: Tim Plunkett <git@plnktt.com> 2011-10-21 04:31:39
Committer: Tim Plunkett <git@plnktt.com> 2011-10-21 04:31:39
Parent: 9b4ddf19b8f1223386dbb6d7e7c1c85570e3a8e2 (Issue #1169694 by danvuquoc, ifeelgood, acouch: Upgrade to PHP SDK ver 3.1.1.)
Branches: origin/7.x-2.x
Issue #1296370 by acouch, doka: Code Cleanup and Fixes.
I can get the button with my own module's form_alter() callback like so:
if (($form_id == 'user_login_block' || $form_id == 'user_login') && fbconnect_get_config()) {
$attr = array();
if (variable_get('fbconnect_fast_reg', 0) && variable_get('fbconnect_reg_options', 0)) {
$attr = array('perms' => 'email');
}
$form['fbconnect_button'] = array(
'#type' => 'item',
'#description' => t('Sign in using Facebook'),
'#markup' => fbconnect_render_button($attr),
'#weight' => 1,
'#id' => 'fbconnect_button',
);
}
Note: I had to change the form item attribute from #value to #markup to get it to render.
I don't know why fbconnect_form_alter() was changed to remove this code. Please help me understand.
Thanks!
T
Comments
Comment #1
smashtoe CreditAttribution: smashtoe commentedComment #2
jcisio CreditAttribution: jcisio commentedI don't know why it was removed. My guess: there was a time when the login stopped function because of API change, thus it was removed.
I readded this code.
Comment #3
smashtoe CreditAttribution: smashtoe commentedThanks, your change handles the form id for user_login_block, but not for the form id for user_login. It's still broken on the user login form.
Comment #4
jaykainthola CreditAttribution: jaykainthola commentedIt should also include in user_login form.
Thanks
Comment #4.0
jaykainthola CreditAttribution: jaykainthola commentedUpdated to include commit history info