The module not work for me anymore. Problem occurs if you let module to create new users while signin (Automatically register new users = YES). I didn't find this yesterday because I tried it on already registered user :(.

Tested on simpletest.me with vanilla twitter 7.x-5.9 without patches. (I'm experiencing same bug with 7.x-5.8+100-dev)
https://dfcq9.ply.st twitter app is configured so you can try it.

Fatal error: Cannot use string offset as an array in /home/dfcq9/www/modules/user/user.module on line 2112

Warning: Missing argument 2 for user_login(), called in /home/dfcq9/www/sites/default/modules/twitter/twitter_signin/twitter_signin.module on line 222 and defined in user_login() (line 2096 of /home/dfcq9/www/modules/user/user.module).
Warning: Illegal string offset 'name' in user_login() (line 2105 of /home/dfcq9/www/modules/user/user.module).
Notice: Array to string conversion in user_login() (line 2105 of /home/dfcq9/www/modules/user/user.module).
Warning: Illegal string offset 'name' in user_login() (line 2112 of /home/dfcq9/www/modules/user/user.module).

This part probably cause it.. user_login expects $form, &$form_state params..

twitter_signin.module line ~224

// Reload the user's account object.
$account = user_login($account->uid);

I think this is pretty critical issue. I'm gonna try to patch it.

Comments

mkolar created an issue. See original summary.

mkolar’s picture

Title: Fatal error and warnings if » Fatal error while registering new user
damienmckenna’s picture

Status: Needs work » Active
damienmckenna’s picture

Version: 7.x-5.8 » 7.x-5.x-dev
Status: Active » Needs review
StatusFileSize
new556 bytes

Does this resolve the problem?

damienmckenna’s picture

StatusFileSize
new568 bytes

I suppose replacing the existing $form_state variable might not be the best approach.

damienmckenna’s picture

StatusFileSize
new510 bytes

Or, you know, I could have been barking up the entirely wrong tree by using user_login() instead of user_load().

damienmckenna’s picture

Version: 7.x-5.x-dev » 7.x-6.x-dev
StatusFileSize
new510 bytes

Ported to 7.x-6.x.

mkolar’s picture

I'll try it in hour..

damienmckenna’s picture

This only affects the two D7 branches.

mkolar’s picture

https://dfcd8.ply.st

installed 7.x-5.x branch with
https://www.drupal.org/files/issues/twitter-n2561609-5-7.x-5.x.patch

still

Fatal error: Cannot use string offset as an array in /home/dfcd8/www/modules/user/user.module on line 2112

Warning: Illegal string offset 'name' in user_login() (line 2105 of /home/dfcd8/www/modules/user/user.module).
Notice: Array to string conversion in user_login() (line 2105 of /home/dfcd8/www/modules/user/user.module).
Warning: Illegal string offset 'name' in user_login() (line 2112 of /home/dfcd8/www/modules/user/user.module).

damienmckenna’s picture

Please test patch #6, not patch #5.

mkolar’s picture

yes, patch #6 works. You can try here: https://df2wc.ply.st

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

  • DamienMcKenna committed da186fb on 7.x-6.x
    Issue #2561609 by DamienMcKenna: Fixed wrong function used to load a...

  • DamienMcKenna committed 1e899c9 on
    Issue #2561609 by DamienMcKenna: Fixed wrong function used to load a...

Status: Fixed » Needs work

The last submitted patch, 7: twitter-n2561609-7-7.x-6.x.patch, failed testing.

The last submitted patch, 4: twitter-n2561609-4-7.x-5.x.patch, failed testing.

The last submitted patch, 5: twitter-n2561609-5-7.x-5.x.patch, failed testing.

The last submitted patch, 6: twitter-n2561609-6-7.x-5.x.patch, failed testing.

Status: Needs work » Needs review
damienmckenna’s picture

Status: Needs review » Fixed

This was already committed.

Status: Fixed » Needs work

The last submitted patch, 7: twitter-n2561609-7-7.x-6.x.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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