Index: fb.admin.inc =================================================================== --- fb.admin.inc (revision 5288) +++ fb.admin.inc (working copy) @@ -34,25 +34,24 @@ foreach ($apps as $fb_app) { // Get properties from facebook. - fb_admin_get_app_properties($fb_app); + fb_admin_get_app_info($fb_app); $row = array(); // Title. $row[] = $fb_app->label . ($fb_app->status ? '' : ' ' . t('(not enabled)')); // New apps no longer have about pages. - $name = isset($fb_app->application_name) ? $fb_app->application_name : $fb_app->label; - if ($fb_app->about_url) { - $row[] = l($name, $fb_app->about_url); - } - else { - $row[] = $name; - } + $name = isset($fb_app->name) ? $fb_app->name : $fb_app->label; + $row[] = $name; // Canvas Page. - if (isset($fb_app->canvas_name) && - $fb_app->canvas_name != $fb_app->canvas) { - drupal_set_message(t('Canvas page for %label is out of sync! Facebook believes it is %fbcanvas, while our database believes %canvas. Edit and save the application to remedy this.', array('%label' => $fb_app->label, '%fbcanvas' => $fb_app->canvas_name, '%canvas' => $fb_app->canvas)), 'error'); + if (isset($fb_app->namespace) && + $fb_app->namespace != $fb_app->canvas) { + drupal_set_message(t('Canvas page for %label is out of sync! Facebook believes it is %fbcanvas, while our database believes %canvas. Edit and save the application to remedy this.', array( + '%label' => $fb_app->label, + '%fbcanvas' => $fb_app->namespace, + '%canvas' => $fb_app->canvas, + ), 'error')); } if ($fb_app->canvas) { $row[] = l($fb_app->canvas, $protocol . '://apps.facebook.com/' . $fb_app->canvas); @@ -101,7 +100,7 @@ function fb_admin_app_page($fb_app = NULL) { fb_get_app_data($fb_app); - fb_admin_get_app_properties($fb_app); + fb_admin_get_app_info($fb_app); $fb = fb_api_init($fb_app); // @TODO use an actual theme function and make render more appealing. @@ -110,7 +109,7 @@ unset($fb_app->data); // Warn user if values have changed since last edit. - foreach (array('canvas_name' => 'canvas', 'application_name' => 'title') as $prop => $key) { + foreach (array('namespace' => 'canvas', 'name' => 'title') as $prop => $key) { if (isset($fb_app->$prop) && $fb_app->$prop != $fb_app->$key) { drupal_set_message(t("The property %prop has been changed to %value on facebook. Go to the Edit tab, confirm values are correct and hit Save button to syncronize the local values.", array('%prop' => $prop, '%value' => $fb_app->$prop)), 'error'); @@ -134,10 +133,9 @@ } // This clause belongs in fb_tab.module. But currently no hook for that tab to add a "property" that is not a true facebook property. - // Note: fb_app->installable no longer means anything. - if ($fb_app->profile_tab_url && module_exists('fb_tab')) { + if ($fb_app->page_tab_url && module_exists('fb_tab')) { // This app can be added to a page. Provide a link to do so. - $add_url = "http://www.facebook.com/dialog/pagetab?app_id=$fb_app->id&next=" . url(FB_TAB_PATH_ADDED . '/' . $fb_app->label, array('absolute' => TRUE, 'language' => FALSE)); + $add_url = "http://www.facebook.com/dialog/pagetab?app_id=$fb_app->id&next=" . url(FB_TAB_PATH_ADDED . '/' . $fb_app->label, array('absolute' => TRUE, 'language' => NULL)); $output .= '
!props', array('%label' => $fb_app->label, '!props' => print_r($props, 1)))); - watchdog('fb_app', 'Set facebook app properties for %label.', - array('%label' => $fb_app->label, + watchdog('fb_app', 'Set facebook app properties for %label.', array( + '%label' => $fb_app->label, ), WATCHDOG_NOTICE, l(t('view apps'), FB_PATH_ADMIN)); } - } catch (Exception $e) { + } + catch (Exception $e) { drupal_set_message(t('Failed to set the following properties for %label application. You may need to manually editing remote settings!
!props', array('%label' => $fb_app->label, '!props' => print_r($props, 1))), 'error'); fb_log_exception($e, t('Failed to set application properties on Facebook. %props', array('%props' => json_encode($props)))); } Index: fb_app.install =================================================================== --- fb_app.install (revision 5288) +++ fb_app.install (working copy) @@ -70,7 +70,7 @@ 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, - 'description' => 'We learn this from facebook app properties', + 'description' => 'We learn this from facebook app properties, facebook now calls it namespace', ), 'title' => array( 'type' => 'varchar', @@ -228,4 +228,3 @@ } return $ret; } - Index: fb_canvas.admin.inc =================================================================== --- fb_canvas.admin.inc (revision 5288) +++ fb_canvas.admin.inc (working copy) @@ -25,18 +25,19 @@ // Paving the way to make URL alters optional. $callback_url = url('', array('absolute' => TRUE)); } - $return['callback_url'] = $callback_url; + $return['canvas_url'] = $callback_url; if (variable_get(FB_VAR_SECURE_URLS, FB_SECURE_URLS_SOMETIMES) >= FB_SECURE_URLS_SOMETIMES) { - $return['secure_callback_url'] = str_replace('http://', 'https://', $callback_url); + $return['secure_canvas_url'] = str_replace('http://', 'https://', $callback_url); } if (variable_get(FB_VAR_SECURE_URLS, FB_SECURE_URLS_SOMETIMES) <= FB_SECURE_URLS_SOMETIMES) { - // Make callback_url HTTP, even if we administer drupal via HTTPS. - $return['callback_url'] = str_replace('https://', 'http://', $return['callback_url']); + // Make canvas_url HTTP, even if we administer drupal via HTTPS. + $return['canvas_url'] = str_replace('https://', 'http://', $return['canvas_url']); } + } elseif ($op == FB_ADMIN_OP_LIST_PROPERTIES) { - $return[t('Callback URL')] = 'callback_url'; - $return[t('Secure Callback URL')] = 'secure_callback_url'; + $return[t('Canvas URL')] = 'canvas_url'; + $return[t('Secure Canvas URL')] = 'secure_canvas_url'; } } Index: fb_connect.admin.inc =================================================================== --- fb_connect.admin.inc (revision 5288) +++ fb_connect.admin.inc (working copy) @@ -10,29 +10,27 @@ */ function fb_connect_fb_admin($op, $data, &$return) { if ($op == FB_ADMIN_OP_SET_PROPERTIES) { - $return['connect_url'] = fb_connect_get_connect_url($data['fb_app']); + $return['website_url'] = fb_connect_get_website_url($data['fb_app']); if (variable_get(FB_VAR_SECURE_URLS, FB_SECURE_URLS_SOMETIMES) == FB_SECURE_URLS_ALWAYS) { - $return['connect_url'] = str_replace('http://', 'https://', $return['connect_url']); + $return['website_url'] = str_replace('http://', 'https://', $return['website_url']); } else { - $return['connect_url'] = str_replace('https://', 'http://', $return['connect_url']); + $return['website_url'] = str_replace('https://', 'http://', $return['website_url']); } } elseif ($op == FB_ADMIN_OP_LIST_PROPERTIES) { - $return[t('Connect URL')] = 'connect_url'; + $return[t('Webiste URL')] = 'website_url'; } } /** - * Convenience method to get an apps connect URL. - * + * Convenience method to get an app's website URL. */ -function fb_connect_get_connect_url($fb_app) { +function fb_connect_get_website_url($fb_app) { // absolute URL with no rewriting applied global $base_url; return $base_url . '/'; - } @@ -85,4 +83,3 @@ ); return system_settings_form($form); } - Index: fb_devel.module =================================================================== --- fb_devel.module (revision 5288) +++ fb_devel.module (working copy) @@ -232,6 +232,7 @@ // server URL sanity check // This is an expensive test, because it invokes api_client. try { + // @todo admin.getAppProperties deprecated. Use graph API instead. $props = $fb->api(array( 'method' => 'admin.getAppProperties', 'access_token' => fb_get_token($fb), @@ -636,6 +637,7 @@ try { // app properties $token = fb_get_token($_fb); + // @todo: getAppProperties deprecated. Use graph API instead. $props = $_fb->api(array( 'method' => 'admin.getAppProperties', 'properties' => 'about_url', 'application_name', Index: fb_tab.admin.inc =================================================================== --- fb_tab.admin.inc (revision 5288) +++ fb_tab.admin.inc (working copy) @@ -24,36 +24,24 @@ // Paving the way to make URL alters optional. $callback_url = url('', array('absolute' => TRUE)); } - $return['profile_tab_url'] = $callback_url . FB_TAB_PATH_VIEW; + $return['page_tab_url'] = $callback_url . FB_TAB_PATH_VIEW; if (variable_get(FB_VAR_SECURE_URLS, FB_SECURE_URLS_SOMETIMES) >= FB_SECURE_URLS_SOMETIMES) { - $return['secure_page_tab_url'] = str_replace('http://', 'https://', $return['profile_tab_url']) . '/'; // Must end with '/' ??? + $return['secure_page_tab_url'] = str_replace('http://', 'https://', $return['page_tab_url']) . '/'; // Must end with '/' ??? } if (variable_get(FB_VAR_SECURE_URLS, FB_SECURE_URLS_SOMETIMES) <= FB_SECURE_URLS_SOMETIMES) { - $return['profile_tab_url'] = str_replace('https://', 'http://', $return['profile_tab_url']); + $return['page_tab_url'] = str_replace('https://', 'http://', $return['page_tab_url']); } } else { - $return['profile_tab_url'] = ''; + $return['page_tab_url'] = ''; } - if ($config['edit_url']) { - // http://forum.developers.facebook.net/viewtopic.php?id=88920 - $return['edit_url'] = url($config['edit_url'], array( - 'absolute' => TRUE, - 'fb_canvas' => $fb_app->label, // @TODO make canvas optional - ));; - } - else { - $return['edit_url'] = ''; - } } elseif ($op == FB_ADMIN_OP_LIST_PROPERTIES) { - $return[t('Profile Tab Name')] = 'tab_default_name'; - $return[t('Profile Tab URL')] = 'profile_tab_url'; + $return[t('Page Tab Name')] = 'page_tab_default_name'; + $return[t('Page Tab URL')] = 'page_tab_url'; $return[t('Secure Page Tab URL')] = 'secure_page_tab_url'; - $return[t('Profile Tab Edit URL')] = 'edit_url'; - $return[t('Installable')] = 'installable'; } }