Jump to:
| Project: | Drupal for Facebook |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | craigmc |
| Status: | closed (won't fix) |
Issue Summary
Hi all--
Found a bug where if I had a user that already exists in Drupal and has already authorized the app through their FB account, that fb_user.module prints an error to watchdog:
"fb_user encountered something it cannot handle. The current user, my_user is logged in. But the facebook user id 512634759 is associated with another user, my_user".
How to reproduce:
Associate a FB user with an existing drupal user-- add a row into the authmap table where uid = your user's UID, authname = fb_id@facebook.com and module = 'fb_user'.
Go to your site's canvas page and log in as your drupal user. The above error gets logged to the DB on every page you visit.
I've attached a patch below to address the issue. The patch also addresses some of the spacing issues in the module (for that section, at least), and removes trailing spaces, per the Drupal coder spec.
Enjoy,
Craigmc
| Attachment | Size |
|---|---|
| fb_user_fix_error_message.patch | 27 KB |
Comments
#1
FYI: relevant code is added ~ line 124.
122: if ($user->uid == 0)123: $user = $account; // change the global user
124: else if ($user->uid != $account->uid) {
125: watchdog('fb_user', t('fb_user encountered something it cannot handle. The current user, !user1 is logged in. But the facebook user id %fbu is
126: associated with another user, !user2',
127: array('!user1' => theme('username', $user),
128: '!user2' => theme('username', $account),
129: '%fbu' => $fbu)),
130: WATCHDOG_ERROR);
131: }
Remaining patch changes are just whitespace tweaks.
#2
Thanks for this.
If you're building a new app, I recommend Drupal 6.x. I'm not planning to support DFF on 5.x much.
#3
Understood. Unfortunately, i'm working on a large-scale site that is quite heavily built into D5 for the time being.
Thanks for your help. I'll try to post any patches I can find back and let you tag-team them back into yr D6 implementation.
Craigmc
#4
Since Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 issues. Issues that haven't moved since D5 are unlikely to still be valid.