Links broken on canvas pages
georgedamonkey - April 30, 2009 - 17:17
| Project: | Drupal for Facebook |
| Version: | 6.x-2.x-dev |
| Component: | Canvas Pages |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Dave Cohen |
| Status: | closed |
Description
I've just installed the module, and created the app in facebook, and everything seems to be working, except for links. All links have a url similar to this:
http://node/11722?_fb_fromhash=2389b2e54e8ecf0d7466771db5c89221
Any ideas on how I can fix this?

#1
can you give me the URL of a page showing this?
What code is generating the links? Are the links in the navigation block broken?
#2
The url of the app is here:
http://apps.new.facebook.com/menashapl
Yeah, the links in the navigation block are broken, as well as all the links within the content for taxonomy, the posts themselves, etc. Not sure what code is generating the links?
Thanks for taking a look at it for me, I really appreciate that.
#3
It looks like it's adding in 'http://' for every link. If I can somehow get it to stop putting that in, I'm thinking it'll work. Does that make any sense?
#4
That's not the fix. You'll end up with apps.facebook.com/node/NNN when what you need is apps.facebook.com/SOMETHING/node/NNN.
Maybe if you set the HTML base attribute in the page template. Hmmmm....
This should all be easier with improved url alters that I think will be in D7. Until then this remains tricky.
Have you enabled the DFF devel module? If not please do.
#5
How do you set the HTML base attribute in the page template?
I hadn't had the DFF devel module enabled, but I do now.
#6
Now that I have the DFF devel module enabled, this is what I get:
Facebook Devel Info
Page Status = Rendering FBML canvas page.
fb_facebook_user = 1335487366
users_isAppUser = 1
users_isAppUser(1335487366) = 1
local user = admin
fb_get_fbu = 1335487366
base_url = http://www.menashalibrary.org
base_path = /
url() returns = /fb_cb/11722/
$_REQUEST[q] is = fb_cb/11722/
arg(0) is = frontpage
arg(1) is =
session_id = fb_canvas_11722_2.jeLoB_qdS8GuzqQL39fY9Q__.86400.1241294400-1335487366
session_name = fb_canvas_11722_SESS8ca7c826e2a224dd5c7e4d73cb733038
I'm guessing the problem is:
base_path = /
?
#7
I'm seeing a similar problem on one of my sites. It used to work fine, so something - drupal or facebook - has changed and this is a nasty side effect. In my case, many links are fine, but some are as you describe.
I'll do my best to track this down.
#8
I see the problem. Hope to fix later today.
#9
Thank you!
#10
fix from may 3 doesn't change anything for me, still broken ALL relative links
http://apps.facebook.com/metrication/
#11
Just checked in a fix, attached. Let me know if there are still problems.
To repair your sites, apply the patch or get the latest version from CVS. Then run update.php script. Then visit each of your Facebook Application nodes edit page and click submit (even if you make no changes). After all that the links on canvas pages should work again.
Not long ago I changed the app form to learn the canvas page suffix by querying facebook, rather than prompting the user. But I was overzealous and removed important info from the fb_app database table. Sorry 'bout that.
#12
Just started trying out the fb module (today, same date as patch above) and found this issue. Applied the patch, followed instructions. Worked great!
Thanks! Looking forward to exploring this more. Very promising!
#13
YES!!! THANK YOU!!!!
I downloaded from cvs, and it works fantastic.
Thank you so much!! I owe you a beer my friend!
#14
Does this mean I have to resave every node? I tried saving the one Facebook Application node, but that makes no difference.
#15
No, of course not every node. You should just have to update the files, run update.php, edit and save the Facebook Application nodes which have canvas pages enabled. For most sites that will be just the one and only Facebook App node.
If you're sure you've done those things, and enabled the fb_devel module, and you still have a problem, then post more details. Like which links are broken. If they're broken the exact way described above, I strongly suspect you haven't updated everything.
#16
Hi Dave, Many thanks. The links were broken exactly as above. But it is all working fine now, all I did after posting #14, was to disable the fb_fbml theme under themes, clear all the blocks settings and cache and re-enable the theme. After this, it all started working as it should.
#17
Automatically closed -- issue fixed for 2 weeks with no activity.