Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The way Twitter Sign in handles the Twitter response is incomplete. In my own implementation, I've had a couple of times that Twitter sent back an empty response - or at least a response that doesn't contain any user data.
The current code doesn't handle this possibility. In my implementation I put the code within a try/catch statement to catch this:
try {
$account = user_save('', $edit);
} catch (Exception $e) {
watchdog('oauth_login', "Exception saving new account: ".$e->getMessage(),'',WATCHDOG_WARNING);
return false;
}
Comment | File | Size | Author |
---|---|---|---|
#16 | twitter-n652680-16-6.x-5.x.patch | 3.61 KB | DamienMcKenna |
#15 | twitter-n652680-15-7.x-6.x.patch | 3.79 KB | DamienMcKenna |
#13 | twitter-n652680-13-7.x-5.x.patch | 3.78 KB | DamienMcKenna |
Comments
Comment #1
steinmb CreditAttribution: steinmb commentedYeah it is important that we catch this before passing them on. Twitter.com might be overloaded, network problems etc. Rerolling without doing a lot of testing just to get this issue rolling again. It is hard to belive that it's been not a single comment since it was posted back in 2009.
Comment #2
13rac1 CreditAttribution: 13rac1 commentedApplies with fuzz to 6.x-5.x. Should ported to 7.x?
Comment #3
13rac1 CreditAttribution: 13rac1 commentedComment #4
xurizaemonDuplicated by #1047262: Twitter does not hanlde app access deny case (patch there also). Should be re-rolled for 7.x-5.x.
Comment #5
xurizaemonComment #6
steinmb CreditAttribution: steinmb commentedDid this patch make it into 6.x?
Comment #7
xurizaemonDoesn't look like it (http://drupalcode.org/project/twitter.git/blob/refs/heads/6.x-5.x:/twitt...) and I hope it would but ideally now coming in via 7.x-5.x first.
https://api.drupal.org/api/drupal/modules%21user%21user.module/function/...
does user_save really throw an exception in d6?
I don't think it does, so that patch feels like it might be improved to identify the cause of the exception here. Oh right, it will be from the SQL insert?
Comment #8
xurizaemon(Sorry, on mobile. Am trying to wrestle this queue into shape - if this patch is good enough to go in, help me better understand the details please.)
Comment #9
DamienMcKennaComment #10
DamienMcKennaComment #12
DamienMcKennaDoes this problem still happen in the 7.x-5.x or 7.x-6.x branches?
Comment #13
DamienMcKennaYes, this could still be a problem with the current version.
Comment #14
DamienMcKennaComment #15
DamienMcKennaPorted to 7.x-6.x.
Comment #16
DamienMcKennaPorted to 6.x-5.x.
Comment #17
DamienMcKennaCommitted. Thanks!