diff --git a/fb.module b/fb.module
index 1edb48657dc43999e78010edc2ec08757bedbc61..8d9259c0b8fd6a37f4ba8aea8cf0f826227a75eb 100644
--- a/fb.module
+++ b/fb.module
@@ -161,14 +161,17 @@ function fb_api_init($fb_app, $fbu) {
if (!count($cache)) {
$filename = variable_get('fb_api_file', 'facebook-platform/php/facebook.php');
-
- if (!file_exists($filename)) {
- // Print an error directly to the canvas page.
- //print("Failed to open Facebook API file $filename. Either fix this problem or disable Facebook modules.");
+ if (!include($filename)) {
+ $message = t('Failed to find the Facebook client libraries at %filename. Read the !readme and follow the instructions carefully.',
+ array('!drupal_for_facebook' => l(t('Drupal for Facebook'), 'http://drupal.org/project/fb'),
+ // This link should work with clean URLs disabled.
+ '!readme' => 'README.txt',
+ '%filename' => $filename,
+ ));
+ drupal_set_message($message, 'error');
+ watchdog('fb', $message);
return NULL;
}
- else
- require_once($filename);
}
global $facebook_config;
diff --git a/fb_devel.module b/fb_devel.module
index 0652d5082e5c8d2b10a1449e52369b5823f11a77..074197aa7b86cc5f9ef60c271b7424fd450f7247 100644
--- a/fb_devel.module
+++ b/fb_devel.module
@@ -48,17 +48,6 @@ function fb_devel_fb($op, $data, &$return) {
watchdog('fb_devel', $message);
}
- // New facebook API sanity check
- if (!variable_get('fb_api_file', FALSE)) {
- $message = t('It looks like you have upgraded from version 1.x to 2.x of !drupal_for_facebook without changing all the necessary settings. Read the !readme and follow the instructions carefully.',
- array('!drupal_for_facebook' => l(t('Drupal for Facebook'), 'http://drupal.org/project/fb'),
- // This link should work with clean URLs
- // disabled.
- '!readme' => 'README.txt'));
- drupal_set_message($message, 'error');
- watchdog('fb_devel', $message);
- }
-
// path replacement sanity check
global $base_path;
if ($base_path == "/{$fb_app->canvas}/") {