Hi,
Seems like I have a little issue with my canvas, but I can't figure what I'm doing wrong. I have my app on Facebook with the correct theme, the content I created for my facebook users but all my links are absolute links, which it means if I click on any navigation item, I'm getting out of Facebook and I go to my website (mywebsite.com/abc insteat of apps.facebook.com/myapp/abc)....
I'm using the latest Drupal 6X core (6.20) and Drupal for Facebook 6.x-3.0-rc11 (also, my library is updated).
In my Canvas settings page, my 2 URL processing checkbox are checked, but it clear that I forgot something somewhere.
As I said, I probably forgot something but I can't figure what exactly I'm missing.
Thanks for your help!
Comments
Comment #1
Dave Cohen commentedread the README.txt and follow instructions carefully.
Comment #2
pyshgavak commentedYeah, I read (and reread as required in the troubleshooting), but I can't see anything wrong. I follow all the instructions.
But here is a strange thing: when I first click on one of my administration menu, it works and then, I can browse my app inside the Facebook iframe. But if I don't have the administration menu (as a normal users), and then I click on the same link I clicked (after clicking any administration link), I'm going on the external version of the site. Even if in both case, my path starts with / (and not http://mywebsite.com/)... Same path, two results.
I took a look at the source code and the links are the same in both case (administration links and menu links).
Comment #3
Dave Cohen commentedWhat exactly did you put in your settings.php?
Comment #4
pyshgavak commentedif (!is_array($conf))
$conf = array();
$conf['fb_verbose'] = TRUE; // debug output
//$conf['fb_verbose'] = 'extreme'; // for verbosity fetishists.
// More efficient connect session discovery.
// Required if supporting one connect app and different canvas apps.
//$conf['fb_apikey'] = '123.....XYZ'; // Your connect app's apikey goes here.
// Enable URL rewriting (for canvas page apps).
// $conf['fb_apikey'] = 'API_KEY_NUMBER'; // Your app's apikey goes here.
include "sites/all/modules/fb/fb_url_rewrite.inc";
include "sites/all/modules/fb/fb_settings.inc";
Of course, I replace the apikey by the good one (I tried with and without the //)
Comment #5
Dave Cohen commentedHmmmm. Since you're including fb_url_rewrite.inc, it *should* work.
Do you have any other module that implement url_rewrite or url_alter functions?
Comment #6
pyshgavak commentedFacebook for Drupal is the only one I know who use url_rewrite or url_alter functions.
I'm also using a couple of modules but nothing very unusual....
Admin menu, cck, css gzip, date, devel, Drupal for FB, filefield, Google Analytics, IE CSS optimizer, image, imageAPI, imagecache, Internationalization, jquerry UI, lightroom2, links, pathauto, poormanscron, sitemap, toggle WWW, token, ubercart, views, webform, wysiwyg and xml sitemap.
My URLs include fr/ because my website is in french (only in french for now but english will follow).
Comment #7
Dave Cohen commentedThere's a function called fb_canvas_process which does some crazy stuff to change links to go to canvas pages. I wonder if the "fr" is screwing it up.
If you view the source of the canvas page frame, what do the links look like? Do they have both "fr/" and "fb_cb/" in them? If so, which comes first?
Comment #8
pyshgavak commentedYeah, that it! By removing the language prefix, it works.
Actually, for your info, the URL path was good (website.com/fr/fb_cb/...). But actualy, there is a tiny little issue (I think). When Drupal overwrite the canvas and page tabs links in the facebook setting page, there is a missing "/" (my results was: /frfb_cb). But, even if I was adding the missing "/" manually when I was editing my app in the last days, it seems like it wasn't enough. :-)
So, I don't know if there is a easy fix I can do, but I can leave with that change on my site!
Comment #9
Dave Cohen commentedSo, your drupal site should have a default language, right? I think the facebook application will need be the default language.
Try enabling language again, but when administering the site, use the default language. That is, the path should be admin/build/fb, and not fr/admin/build/fb when administering facebook apps. Then, when you save the app, the callback will not have "fr" in it.
I thought I had fixed something along these lines a while ago, but my memory sucks so I can't remember exactly what it was.
Comment #10
pyshgavak commentedYup, it works!
Thanks Dave.
Comment #12
mottolini commentedI'm sure I never administered the site with a language different from the default one, but I got same error: canvas pages were called with a it/ (the second language I added is italian) prefix.
I even disabled all internationalization modules (even core Locale and Content Translation) without any change. When I ask to sync properties, I get all the URLs (uninstall, authorize, callback, etc) with a it/ prefix. Now i manually changed the settings in the facebook app on facebok.com, but I'm sure that next time I change something in the drupal app, after an automatic prop sync, I will come back to have a it/.
Comment #13
mottolini commentedI'm trying to isolate the problem and I want to post here some info that could help:
- admin is not a facebook user
- function url() for admin returns it/
- admin language is english
- links and settings for "normal" users seem OK
Comment #14
mottolini commentedThe problem #12 was in a setting of the multilingual system: language negotiation was set to "Path prefix with language fallback" and i was using two different systems as an admin, one with italian browser and another with english one. Changing to "Path prefix only" fixed the problem. I guess it should work if admin uses only default language browsers as well.