Fatal error: Call to undefined function libraries_load() in /home/xxxxx/public_html/xxxx.com/sites/all/modules/fbconnect/fbconnect.module on line 363

CommentFileSizeAuthor
#23 typo-1328452-22.patch303 bytesFeet
#9 fatal-error-1328452-9.patch323 bytesJamesAn

Comments

tastynuggets’s picture

Are you using the 7.x-1.0 version of Libraries?

I think the 7.x-2.0-alpha1 is required.

farnsworth’s picture

thanks that solved the fatal error problem but i am still getting

Facebook PHP sdk Not installed

2. Upload facebook-php-sdk library (http://github.com/facebook/php-sdk/) into the libraries
folder.

now is this the libraries folder in sites/all/libraries
or is this the libaries folder in sites/all/modules/libraries

because the libraries module needs to be installed for this to work.

further more what does it need to be called

the folder that unpacks from the zip that i downloaded is facebook-php-sdk-dafef11
1. does it stay in that folder
2. what should the folder be called.

Thanks again for any help you can provide.

I assumed it should go in sites/all/libraries but i have still not figured out what the folder should be called.

Edit: i am not getting any errors but http://drupal.org/node/1318296 says one line needs to be changed or to manually empty the tables any ideas.

Edit2: I am messing around with stuff now and after clearing the the table in cache_libraries i got Notice: Undefined offset: 1 in libraries_get_version() (line 723 of /home/earthman/public_html/fbc/sites/all/modules/libraries/libraries.module).

which i looked at the code for the patch and the only thing i could see that changed was

 while ($options['lines'] && $line = fgets($file, $options['cols'])) {
      if (preg_match($options['pattern'], $line, $version)) {
        fclose($file);
!       return $version[1];
      }
      $options['lines']--;
    }
--- 720,726 ----
    while ($options['lines'] && $line = fgets($file, $options['cols'])) {
      if (preg_match($options['pattern'], $line, $version)) {
        fclose($file);
!       return $version[0];
      }
      $options['lines']--;

0 rather then one which i changed and that took care of the error but now i am left with the same error as before not finding the file.

tastynuggets’s picture

Yes, the sites/all/libraries path is correct. The facebook.php should be located at:

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

I had the same issue with the SDK not being found. After some digging I found that the libraries API actually had found the SDK, it just couldn't figure out the version: The version of the Facebook PHP SDK library could not be detected, even though the status report said Facebook PHP library not found. A bit misleading.

This fix seems to correct the version issue: http://drupal.org/node/1318946#comment-5169470

gberm’s picture

I am also having similar problems, but when I enable the module my /admin/config get an error 500 error when I try to access it.

Any suggestions?

farnsworth’s picture

if you can start with a fresh non cpanel / fantastico install for some reason it messes up the database a bit and these modules do not like that.

Follow the steps on updating the code before you install ( turn on ) the modules for the first time. If i have time tomorrow i will do a step by step on how I go it working.

ddhhz’s picture

I have the exact same problem as #4. 500 returned when trying to access configuration. When I disable fbconnect module, it all returns back to normal.

farnsworth’s picture

did you run the patch? or change the code, if you look at what i posted which is actually in the wrong place ( i was working from 2 different posts ) when i solved the issue. search around i know i posted the solution here some place. If you can not find it I will do a clean install and resolve the issue with steps again for you. just post back.

JamesAn’s picture

Title: Fatal Error after installing » Facebook Connect depends Libraries API 2.0-alpha1 or greater but doesn't check for it

I can confirm that this module does indeed require Libraries API 2.x. The PHP fatal error resulting in these 5xx error codes is that libraries_load() is only implemented in Libraries API 2.0-alpha1.

Note: when you upgrade Libraries API from 1.0 to 2.0-alpha1, you'll also need to run the update script on the database, otherwise you'll get a non-fatal PHP error on every page load.

JamesAn’s picture

Title: Facebook Connect depends Libraries API 2.0-alpha1 or greater but doesn't check for it » Facebook Connect depends on Libraries API 2.0-alpha1 or greater but doesn't check for it
Status: Active » Reviewed & tested by the community
StatusFileSize
new323 bytes

Here's the one-liner patch. Drupal 7 introduced dependency version constraints to prevent situations just like this, where Facebook connects requires the latest Libraries API and does not work with the earlier versions.

JamesAn’s picture

Status: Reviewed & tested by the community » Needs review

Oops. Can someone confirm that the patch works as advertised? Thanks!

ondemandcommercials’s picture

THIS was my problem.

Redid my install without fantastico and then my problems started to match what I've seen on the forums a bit more. [1] index problem etc.

Now it's at least basically functional for me.

Racerx55’s picture

Can't load Configuration because of-
Fatal error: Call to undefined function libraries_load() in /home/content/r/a/c/racerx55/html/4wide/cms/sites/all/modules/fbconnect/fbconnect.module on line 363-
Using Libraries 7x-1.0, how do I update to Alpha? Won't install, says Libraries is already installed. Can't disable FB Connect or Libraries.

damien_vancouver’s picture

Status: Needs review » Reviewed & tested by the community

The patch from #9 properly prevents me from enabling the module (although not in Drush, but that's a drush issue I think).

The dependencies list correctly shows Requires: Libraries (>=2.0-alpha1) (incompatible with version 7.x-1.0).

Marking Reviewed and Tested by the Community.

Note that installing the patch won't fix the error - you have to upgrade your Libraries for that. This patch just prevents you from enabling the module until you have the correct Libraries version.

jpmizell’s picture

I'm unclear here.
On a clean instal of D7 with Libraries 7.x-1.0
I install library package: facebook-php-sdk-v3.1.1-21-g5a88ed7
Upload to to: sites/al/libraries/
I remove the -g5a88ed7 from the directory name, ending up with: sites/all/libraries/facebook-php-sdk/src/facebook.php
In enable Fbconnect 7.x-2.x-dev

Blamo!
my_site/admin/config delivers:
"Fatal error: Call to undefined function libraries_load() in /home/user/my_site/sites/all/modules/fbconnect/fbconnect.module on line 363"

Is there something I'm missing in the notes here? Thanks.

jamesbenison’s picture

Yes, the sites/all/libraries path is correct. The facebook.php should be located at:

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

Please add this to the README

jamesbenison’s picture

Another piece of critical information...if you want this to work.

http://drupal.org/node/1318946

jcisio’s picture

Status: Reviewed & tested by the community » Fixed

A patch similar to #9 has been committed. Thanks!

xlyz’s picture

Status: Fixed » Active

at the moment it's not possible to enable the module. it can't be:

dependencies[] = libraries (>= 2.0)

as libraries is still @ alpha2.

drdave17’s picture

strike!

jcisio’s picture

Status: Active » Fixed

Sorry I was testing with libraries 2.x-dev only. Fixed in beta2.

ashleyhazle’s picture

Status: Fixed » Needs work

The .info file has a typo: oname = Fbconnect

Sorry I don't know how to upload a patch, but shouldn't take you long ;)

Thanks for all your work jcisio :)

Feet’s picture

StatusFileSize
new303 bytes

I put a patch together for this (spelling mistake 'oname')

This is my first patch so apologies if I've done it wrong, please inform if so.

jcisio’s picture

Status: Needs work » Fixed

Really sorry! Beta3 has been released.

Status: Fixed » Closed (fixed)

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