The fb module creates accounts just fine when not connecting via facebook as it automatically takes over the reg form. Therefore a user can use his facebook account to get a site account OR register straight forward without using facebook account. You obviously know this but I had mention it. The problem I'm having is that I need registering users to login immediately when they decide to create an acc. Without using their facebook account. My reg form does not show the password fields do not show up on the form when fb module has taken over it and drupal will not give an immediate login unless people set passwords.

I don't see an issue for this so I may be missing a link on this one as I'm sure many people need this type of feature.
Marked as issue as may already be a feature
Using login toboggan
Immediate loggin works when user uses their facebook account to register
I also obviously put the system to immediate loggin under user settings page

Basically I'm struggling to show the password fields in reg form when fb module takes over it, please help.

Thanks in advance

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Cohen’s picture

Disable fb_registration.module. Don't enable all the module/fb modules. Just the ones you need for your site.

There are some form elements in Drupal which fb registration form cannot support. Others can be supported via a custom form alter or a patch to fb_registration.module. If you don't know how to go about that, best to not use that module.

thedavidmeister’s picture

Status: Active » Needs review

sup.

Add this to the definition list of Drupal fields that fb_registration can handle in _fb_registration_extract_fb_fields().

      elseif ($form[$key]['#type'] == 'password_confirm') {
        $field = array(
          'name' => 'password',
        );
      }

And this in fb_registration_form_alter() under the almost identical handling for the 'email' field:

         elseif ($key == 'password' && is_string($value)) {
            // Drupal expects 'pass' with two values for comparison not 'password' as a string.
            if (!isset($state['values']['pass'])) {
              $state['values']['pass'] = array('pass1' => $value, 'pass2' => $value);
            }
          }

As it turns out, facebook's registration form enforces minimum 8 character passwords which is really convenient for integration with Drupal :)

Dave Cohen’s picture

Looks resonable. Any chance you can make a real patch file out of that? Would be much easier to work with.

http://drupal.org/node/707484

thedavidmeister’s picture

I can make a patch for sure, but I'm working with a version of the file that I cleaned up in #1776004: Code doesn't meet Drupal's coding standards so it was easier for me just to copy and paste the relevant lines in since whatever patch i made would not apply cleanly to anything in the d.o. repository.. sorry about that, I was on deadline for something >.<

thedavidmeister’s picture

Patch attached. I also swapped out that fairly epic string of elseif() with a single switch() to make it that little bit easier to extend in the future :)