When I visit any profile (for example, /user/1) I receive the following error:
Fatal error: Call to a member function getAppId() on a non-object in /home2/sparklf6/public_html/sites/all/modules/fb/fb.module on line 450

I've enabled the devel block, it tells me "Page Status = Facebook SDK initialized. User is not logged into facebook or has not authorized application." at the very beginning which is humorous since I used fb to log into the site. I've gone through the readme and added lines [back] into the xhtml and added the whole chunk of code at the bottom of the readme as suggested.

This error popped up after upgrading from D6 to D7.

CommentFileSizeAuthor
#14 fb_module_token.patch653 bytesalasda

Comments

Dave Cohen’s picture

Thanks for the report.

Do you have more than one application configured? If only one, is the "primary" checkbox selected?

asaal’s picture

Hi Dave,

the same problem exists on my side ...

One application and the primary field is selected.

I have checked the source of fb.module ... the $GLOBALS['_fb'] is not set
but used in many modules of facebook for drupal.

Best regards,
Alex

Dave Cohen’s picture

Title: Fatal Error - line 450 - on viewing user profile » Fatal Error - fb.module line 450 - on viewing user profile

Thanks for info, will look into this.

I can tell you the wrong page status is a problem in fb_devel.module. That works properly when you include modules/fb/fb_settings.inc in your settings.php, but I recently noticed it is wrong otherwise. Will fix (eventually).

cybernostra’s picture

Same, receive :
Fatal error: Call to a member function getAppId() on a non-object in /homez.52/medianos/www/drupal7/sites/all/modules/fb/fb.module on line 449

after commented for testing purpose the fb_settings.inc in my settings.php cause i've noticed somes stranges interactions between my fb app and the d7 site in the user authorize scheme and the facebook connect module.

l33tdawg’s picture

sub

john_b’s picture

Same error message for me.

After enabling fb connect module the site was still working OK. I could log in to my FB account via the Connect button, but that did NOT log me in to the Drupal site. No error message, with Devel. not enabled.

After I enabled fb User module, I could log in to my existing (admin) account on the Drupal 7 site with my Facebook details. (As a separate problem, even when I changed admin's email address on the Drupal 7 User page, the facebook login took me straight to the Drupal 7 admin account originally set up with, but no longer using, the email address I use for facebook.)

However, after using this log-in method a couple of times, I started getting the error message in this thread. As Anonymous I could see a homepage with no css and the error message at bottom. It was still possible to log in as a non-admin Authenticated user on an account not associated with FB. However it was impossible to log in with the admin account I had accessed a couple of times via FB Connect, I just got the error message and nothing else on the screen. I removed the entire fb module directory to regain access to my site.

willhowlett’s picture

subscribing

jessepinho’s picture

Same problem for me (but on line 449, not 450). Subscribing.

frankstar’s picture

Subscribing.

Dave Cohen’s picture

Assigned: Unassigned » Dave Cohen

I have a fix for D6 that I will get checked in before long.

workaround, find the fb_get_token() function and change this...

  if (!$fb)
    $fb = $GLOBALS['_fb'];

... into this...

  if (!$fb)
    $fb = $GLOBALS['_fb'];
  if (!$fb)
    return;

(insert those two lines)

acoustika’s picture

subscribing

jaialin’s picture

subscribing for D7.

Workaround in #10 works.

I did read the README.txt from start to finish. ;)

Michsk’s picture

#10: worked on my D7 site, thanks for this my whole site was screwed up :P

alasda’s picture

Status: Active » Needs review
StatusFileSize
new653 bytes

Patch for review.