I want to use twitter account to login my drupal site,so I enabled the "twitter" and the "Twitter Signin" modules.

When I logged in twitter and the page come back to the callback url, it shows that:

•Notice: Undefined index: account in twitter_oauth_callback_form_submit() (line 459 of D:\wamp\www\drupal7\modules\twitter\twitter.pages.inc).
•Notice: Trying to get property of non-object in twitter_oauth_callback_form_submit() (line 464 of D:\wamp\www\drupal7\modules\twitter\twitter.pages.inc).
•Notice: Trying to get property of non-object in twitter_oauth_callback_form_submit() (line 467 of D:\wamp\www\drupal7\modules\twitter\twitter.pages.inc).

My drupal version is 7.4, I also test in 7.1 but with the same issues.

Comments

aixi’s picture

I had same problem. Any one can help?

michaek’s picture

I know I say this on just about every 7.x issue, but this branch of the module is -dev for a reason (that is, it's not really functional), and there is currently no work being done on 7.x.

The 7.x branch was provided to give contributors a way to provide patches that might actually get committed to a codebase, not to provide a meaningfully functional module (yet).

darrylh’s picture

StatusFileSize
new1.35 KB

Patch to fix the above issues.

jmstout’s picture

Darrylh's above patch didn't fix it for me. Anyone else?

I'm assuming everyone is also getting the access denied page along with this?

Crossfeed’s picture

I applied the Patch manually and it worked for me.

rana_krunal9’s picture

having same issue...tell me how to fix this...

berdyshev’s picture

StatusFileSize
new1.72 KB

The attached patch fix the errors. To avoid the display of the Access Denied message, you should enable permission 'Add Twitter accounts' for the user's role. Maybe visibility of the Signin button should depend on this permission (to be discussed).

berdyshev’s picture

Status: Active » Needs review
dimon4ikzp’s picture

It works for me, thanks!

juampynr’s picture

Status: Needs review » Active

Commited BerdArt's patch. Now the process works when an existing user has already added his Twitter account and attempts to sign in with Twitter, but the process ends at user//edit/twitter, where uid is missing.

If a new user tries to sign in with Twitter, he ends in the user/register form but neither the registration or login tab work.

I will investigate in these two workflows. If anyone wants to help with further feedback or patches, they are very welcome.

Cheers

juampynr’s picture

Fixed: http://drupalcode.org/project/twitter.git/commitdiff/815a5ac97137316a1aa...

Now users with an associated Twitter account can sign in with Twitter, and they are redirected to their Twitter account after being logged in (ie, it ends at user/1/edit/twitter).

I will now investigate the scenario for new users. Ideally their account should be automatically created .

juampynr’s picture

Status: Active » Fixed

Fixed too: http://drupalcode.org/project/twitter.git/commitdiff/1594c3d089b090f4eb2...

Added logic to hook_user_insert on twitter_signin module so if a new user did
sign in with Twitter, the Twitter account is saved and related to his user account.

Marking it as fixed. As there has been good improvements that allow posting to Twitter and sign in with Twitter, I will release a new beta.

Thanks everyone.

PD: please create new issues for bugs related to sign in so we can specify the different scenarios.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hawkeye217’s picture

Perhaps this is by design, and ultimately caused by the fact that twitter oauth does not give us email addresses, but when creating a new Drupal user account through a signin with twitter, user_password() generates a random password for the Drupal user account:

      $account = array_shift(user_load_multiple(array(), array('name' => $response['screen_name'])));
      if (empty($account->uid)) {
        $edit = array(
          'name' => $response['screen_name'],
          'pass' => user_password(),
          'init' => $response['screen_name'],
          'status' => 1,
          "authname_twitter" => $response['user_id'],
          'access' => REQUEST_TIME,
        );
        $account = user_save('', $edit);

Though the new user is technically logged in at that point, the created Drupal user account can never have an email address saved with it because a password, which was randomly generated, is required to change the email address in user/xx/edit, and the user can't email themselves the randomly generated password.

Catch 22...

Thoughts? Ideas?