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
Comment #0.0
elvizzi commentedcorrection
Comment #1
elvizzi commentedComment #2
decipheredComment deleted, I'll see if I can replicate this shortly.
Comment #3
milos.kroulik commentedI also experience this with multiple libraries. The above mentioned workaround doesn't seem suitable for me.
Comment #4
elnovak commentedI am also having trouble with this. Is anyone working on the issue for D7?
Comment #5
hello@melmcdougall.com commentedSame 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?
Comment #6
realityloop commentedfixed
D7 http://drupalcode.org/project/fbphotosync.git/commit/86ed0fc
D6 http://drupalcode.org/project/fbphotosync.git/commit/56d9482
Comment #7.0
(not verified) commentedcorrection