summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Cohen2009-02-03 22:54:42 (GMT)
committer Dave Cohen2009-02-03 22:54:42 (GMT)
commita5081d87d94b2562438638c191c30c7f6d6ac928 (patch)
treeda645b0d02b0e4b5d11c4866d6981be7f38b0466
parentc4c0467cecce20ea50fe434a113de671350c1e14 (diff)
Now showing error message when facebook api could not be loaded.
-rw-r--r--fb.module15
-rw-r--r--fb_devel.module11
2 files changed, 9 insertions, 17 deletions
diff --git a/fb.module b/fb.module
index 1edb486..8d9259c 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' => '<a href='.base_path() . '/' . drupal_get_path('module', 'fb') . '/README.txt>README.txt</a>',
+ '%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 0652d50..074197a 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' => '<a href='.base_path() . '/' . drupal_get_path('module', 'fb') . '/README.txt>README.txt</a>'));
- drupal_set_message($message, 'error');
- watchdog('fb_devel', $message);
- }
-
// path replacement sanity check
global $base_path;
if ($base_path == "/{$fb_app->canvas}/") {