Besides the facebook-php-sdk library my site has ckeditor and galleria libraries, and when doing anything with the FB Photo Sync module I get the error:

Fatal error: Class 'Facebook' not found in /home/site/public_html/beta/sites/all/modules/fbphotosync/fbphotosync.module on line 87.

My work around has been to put the facebook "src" folder in my ckeditor library and galleria library. I don't quite understand the code yet, but this function in fbphotosync.module is requiring the sdk src folder to be in all libraries:

function fbphotosync_facebook_sdk($reset = FALSE) {
  if (variable_get('fbphotosync_library', NULL) == NULL || !include_once libraries_get_path(variable_get('fbphotosync_library', '')) . '/src/facebook.php') {
    foreach (libraries_get_libraries() as $library => $path) {
      if (strstr($library, 'facebook-php-sdk') == 0) {
        variable_set('fbphotosync_library', $library);
        include_once "{$path}/src/facebook.php";
        //include_once "sites/all/libraries/facebook-php-sdk/src/facebook.php";
        return fbphotosync_facebook_sdk_initialize($reset);
      }
    }
    return FALSE;
  }
  return fbphotosync_facebook_sdk_initialize($reset);
}

If you can figure it out before I do, Thanks!!

Comments

elvizzi’s picture

Issue summary: View changes

correction

elvizzi’s picture

Priority: Normal » Major
deciphered’s picture

Comment deleted, I'll see if I can replicate this shortly.

milos.kroulik’s picture

Priority: Major » Critical

I also experience this with multiple libraries. The above mentioned workaround doesn't seem suitable for me.

elnovak’s picture

I am also having trouble with this. Is anyone working on the issue for D7?

hello@melmcdougall.com’s picture

Same problem here in D6. Looks like this line is the problem.

if (strstr($library, 'facebook-php-sdk') == 0) {

Worked fine when I changed it to this:

if ($library == 'facebook-php-sdk') {

Really weird thing, is that it kept working again once I switched it back to the original version? Perhaps this is only a problem until it's initialised, then works ok after that?

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

correction