Closed (won't fix)
Project:
Drupal for Facebook
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2008 at 09:31 UTC
Updated:
17 Jan 2012 at 12:55 UTC
On a new install from the latest (yesterday's) dev release, any links in my Facebook app containing the # sign (such as links to add comments etc) are broken, due to the app name being repeated in the url.
In my example, my app is called boinngbook and can be found at http://apps.facebook.com/boinngbook
The majority of links are fine, but any of the add comments or other links containing the hash sigh (#) are rendered like this: http://apps.new.facebook.com/boinngbook/boinngbook/fb_cb/3448/story/cuil-starts-stops#app20557272402_comments (my bold) resulting in 404 errors when clicked.
Comments
Comment #1
Dave Cohen commentedThanks for submitting a new issue. There's a regular expression in fb_canvas_process() which mucks with all links. For example a link ending in #new has to be changed to #appNNNNNNN_new (because facebook changes all element ids this way).
Apparently there is a case (when the base_url is "/"?) when this is not working properly. Either because the regexp is written badly, or because two patterns match the link in these cases, so two replacements happen.
I haven't had time to track it down further.
Comment #2
Boinng commentedOk - I have literally no idea what I'm doing, but I experimented by changing line 375 in the file fb_canvas.module:
$replacements[] = "=\"/{$fb_app->canvas}/$1app{$fb_app->id}_";to this:
$replacements[] = "=\"/$1app{$fb_app->id}_";and so far it appears to have solved the problem. Of course, I don't know the significance of the portion of the link I removed (/{$fb_app->canvas}) other than that it appears to return the app name, so I've no idea if I've broken anything else by doing this. Let me know if I'm helping or just complicating things..
Comment #3
Letharion commentedSince Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 issues. Issues that haven't moved since D5 are unlikely to still be valid.