I have uploaded the Facebook PHP sdk to sites/all/libraries
so the path is /sites/all/libraries/facebook-php-sdk/src/facebook.php
but when i run cron i get Facebook PHP library not found
I'm using v3.1.1
clicking on Appearance tab on Fbconnect shows
Fatal error: Call to a member function getUser() on a non-object in /sites/all/modules/fbconnect/fbconnect.module on line 408

anyone whats going on? or what am I doing wrong?
I do have an app made on facebook and entered the correct information in fbconnect settings

Comments

rklawson’s picture

I had the same problem, but I was able to get the library to load after fixing an error in line 723 of the Libraries module. I submitted a patch for this here:

http://drupal.org/node/1318946

Desi Raaj’s picture

thank you so much, that solved the problem :)

Desi Raaj’s picture

Status: Active » Fixed
AnilM’s picture

Status: Fixed » Active

I'm seeing the exact same problem. Tried the fix mentioned above as well, but with no luck. Any other ideas?

giariv’s picture

Issue tags: +fbConnect, +Libraries

Same problem of AnilM ... I've manually fixed the offset value as described here http://drupal.org/node/1318946 but still gettin' the same error:

"Fatal error: Call to a member function getUser() on a non-object in [...]\sites\all\modules\fbconnect\fbconnect.module on line 408" (<- I've a local test installation of Drupal in my Windows machine)

And under [...]/admin/reports/status I obtain "Fbconnect : Facebook PHP library not found. See README.txt"

Cannot understand the problem. I tried to move the "facebook-php-sdk" folder i different places:
- [...]\sites\all\libraries
- [...]\sites\all\modules\fbconnect
- [...]\sites\all\modules\libraries
... but without any solution.

I've installed the 7.x-2.0-alpha1 version of the "Libraries API" module and the v3.1.1-0 version of the FaceBook Sdk libraries.

Waiting for someone's smart advice.
ThankU very much!

Agogo’s picture

One thing that worked for me was to empty a table in the DB called cache_libraries. It seems the Libraries module remembers that it doesnt know where the particular library is - even though youve moved it.

So the error that keeps showing up is the first error, over and over again.

gberm’s picture

I am having the same problem. I also do not have cache_libraries in my DB

Any suggestions?

synth3tk’s picture

@gberm: Try running your update.php. That seemed to work for me. If you don't know where it's at, visit www.example.com/update.php (obviously replacing "example.com" with your own domain).

waverate’s picture

rklawson's patch in original post of #1318946: Notice: Undefined offset: 1 in libraries_get_version() worked.

Same installation and symptoms as the original post. I was using fbconnect-7.x-2.x-dev (2011-Oct-21) and libraries-7.x-2.0-alpha1. Patch was applied to libraries.module

Thank you.

terbs’s picture

I had all the above problems.

1. I had the "Undefined offset: 1 in libraries_get_version()" error. I noticed keeping the folder naming convention for the folder resolved the offset error in libraries: facebook-php-sdk-dafef11

2. However, naming the folder that way screwed up FBConnect. The solution here is to name the folder facebook-php-sdk and modify the library module like the original poster said.

3. I also had problems with my cache. Turning on the FBconnect module without turning on libraries first caused drupal to skip over setting up the cache_libraries table, mine was missing completely. The solution for that was to uninstall both FB connect and libraries, then re-enable libraries, and re-enable FBConnect

whew! good luck everyone.

AnilM’s picture

I'm hoping to get some clarification on the location of the required modules. Is the following the correct path for the libraries api module (and the facebook-php-sdk folder):
sites/all/libraries
sites/all/libraries/facebook-php-sdk

And the fbconnect module itself goes under:
sites/all/modules/fbconnect/

With this directory structure, will the fbconnect module be able to find the facebook library (facebook-php-sdk)? I had some trouble with this before.

I'm still running into the same problem as mentioned above but I'm hoping a fresh uninstall and re-install in the correct order (libraries first, then fbconnect) will help resolve the issue.

Also, which version of the libraries module is being used? 7.x-1.0 or 7.x-2.0-alpha?

waverate’s picture

AnilM,

Path to facebook.php (from Facebook PHP API)

/sites/all/libraries/facebook-php-sdk/src/facebook.php

Path to fbconnect.info (from fbconnect-7.x-2.x-dev)

/sites/all/modules/fbconnect/fbconnect.info

and using libraries-7.x-2.0-alpha1 with patch in original post of #1318946: Notice: Undefined offset: 1 in libraries_get_version() applied.

AnilM’s picture

So if I use the above paths, I get the following error:
Call to undefined function libraries_load() in /home/content/81/8390081/html/sites/all/modules/fbconnect/fbconnect.module

Which seems to only be resolved if I place the libraries folder in the sites/all/modules path. Does anything need to be changed so that the fbconnect module can find the libraries under sites/all/libraries instead of searching under sites/all/modules/libraries?

waverate’s picture

The above paths were relative to Drupal root.

Is the Drupal index.php located at /home/content/81/8390081/html? If so, then I guess you are good.

I wouldn't have expected to install libraries in modules directory. I would expect /sites/all/modules/library to be a module and contain and library.info file.

kmkivist’s picture

Hey there,

I've tried all the things in this thread but I'm still getting this error:

Fatal error: Call to a member function getUser() on a non-object in C:\wamp\www\drupal-7.9\sites\all\modules\fbconnect\fbconnect.module on line 408

What else I could possibly do? I have only a little experience in Drupal so I'm depending on you guys in this.

terbs’s picture

Check the status report page and make sure fbconnect has loaded the library correctly.

AnilM’s picture

Step #3 of post #10 is what really did the trick for me. Somewhat annoying that so much wasted time was resolved by just that but, none-the-less, it's working now.

awesome_cricket’s picture

i am battling this error like mad right now.

it's actually all between the "not found," error and the following in my apache log directory,

[Mon Nov 28 12:27:30 2011] [error] [client ip address] PHP Fatal error: Call to a member function getLoginUrl() on a non-object in C:\\xampp\\htdocs\\drupal\\phsales\\sites\\all\\modules\\fbconnect\\fbconnect.pages.inc on line 231, referer: http://120178.tk/phsales/fbconnect/register/prompt

[Mon Nov 28 12:26:11 2011] [error] [client ip address] PHP Fatal error: Call to a member function getUser() on a non-object in C:\\xampp\\htdocs\\drupal\\phsales\\sites\\all\\modules\\fbconnect\\fbconnect.module on line 408, referer: http://120178.tk/phsales/

guys, i need some serious help on this. i am using the latest dev releases of both FBConnect & Libraries. you have no idea how burnt out i am on this.

awesome_cricket’s picture

honestly, i am going to harm someone if i don't get this rectified.

awesome_cricket’s picture

You gotta be f'n jokin'! No help still!!!!!!

likewhoa’s picture

Category: support » bug
Priority: Normal » Major

awesome_cricket you're never going to get HELP with that attitude. Changing status to reflect priority since this prevents you from using the module all together.

FR6’s picture

What I did to make it work:

  • Install and activate module Librairies (need at least 7.x-2.0-alpha1).

    If you have any problems saying "Base table or view not found" uninstall the module (admin/modules/uninstall) and make sure you have at least version alpha1. See comment #4 from klonos.

  • Install module Facebook Connect.
  • Download Facebook PHP SDK from GitHub and put it into "/site/all/libraries/facebook-php-sdk".
  • Apply patch from comment #6 like rklawson said.
  • Make sure to clear the cache (admin_menu/flush-cache?destination=admin/reports/status).

@awesome_cricket you will not get any help when being an ass.

apaxito’s picture

@FR6 You are my god! Thanks a lot!

awesome_cricket’s picture

ur an ass FR6

JamesAn’s picture

Status: Active » Closed (duplicate)

I can confirm that this issue is indeed fixed by the patch in #1318946-6: Notice: Undefined offset: 1 in libraries_get_version(). I decided to patch this myself and arrived independently at the identical fix.

It's just a mistake in implementing hook_libraries_info(), namely that the version pattern must have a parenthesized sub-pattern. The first sub-pattern is used as the library's version, which in this case should be "3.1.1" or something similar.

Without this sub-pattern, no version number will be found; no version number means no library, as far as Libraries API is concerned.

I'll mark this as a duplicate of #1318946: Notice: Undefined offset: 1 in libraries_get_version() since that issue has the correct patch.

Just like it was mentioned in #1318296-22: Facebook PHP library not found, be sure to clear your cache after applying this patch to get Drupal to try and detect the library again.

cjs_’s picture

Sorry, accidentally posted this on another issue ticket. Should have been here:

Not sure what to do at this point.

Have applied the latest patch to libraries.module and fbconnect.module, flushed cache, disabled both libraries and fbconnect and re-enabled, flushed cache again.

Retried this several times to no avail. Still get the undefined getUser() and status report shows Facebook SDK not found.

facebook.php and base_facebook.php reside in

/sites/all/libraries/facebook-php-sdk/src/

Can't seem to make any headway getting this fixed.

Libraries is the alpha version, btw.

Any insight is appreciated.

geofffitch’s picture

@FR6 Thanks!

cwithout’s picture

@cjs_ Did you make sure the libraries directory and all sub directories have read permissions. The library module opens and reads the directory, so it needs to have permission for it.

The permissions should ideally be 755 with chown to your webserver user. You can also test with 777.

yannisc’s picture

Same problem here.

I have facebook.php and base_facebook.php in sites/all/libraries/facebook-php-sdk/src.

Using fbconnect 7.x-2.0-beta3, libraries 7.x-2.0-alpha2.

yannisc’s picture

One cause of the problem was that I was geting the facebook libraries by wget from github, but this fetched the wrong files!

The right ones are:

https://raw.github.com/facebook/facebook-php-sdk/master/src/facebook.php
https://raw.github.com/facebook/facebook-php-sdk/master/src/base_faceboo...

I still get the "Unable to load the required Facebook library, please check the README.txt for instructions on how to resolve this." error though even after I flushed caches, uninstalled and reinstalled libraries and the fbconnect module.

vibrasphere’s picture

Use Libraries v1 not v2 (the yellow one). No need for any patches. Works with D7 7.14