Closed (fixed)
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 17:49 UTC
Updated:
11 Aug 2011 at 05:01 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bleen commentedsub
Comment #2
Dave Cohen commentedIt is intended to fix caching problems.
For example if your cached page shows a facebook connect button, but after the user connects you want to show their name and profile pic... well, you don't want the cached page. For most sites, being connected to facebook is like being logged into drupal, and caching is not desirable.
It's true that carefully built sites may still want caching on these pages. I'm open to configuration option that prevents the fbu from being appended, as long as the default is to append the fbu. I'll review any patches that do that.
Comment #3
breathingrock commentedThis patch adds an administrative checkbox to make the "fbu" parameter optional when calling FB_JS.reload().
Patch is from directory above the fb/ directory.
Comment #4
breathingrock commentedA better patch.
Comment #5
Dave Cohen commentedThat patch is easier to read, for sure. I haven't looked it over in detail yet. I'm a little worried about the approach, as it removes the URL parameter but still reloads. In your case, the reload hits the cache, there's really no reason to do it. And also I'm not sure why, if the reload comes from the cache, you are not starting an infinite series of reloads. Because in the theory the page should also be served as if the user is not logged into facebook, and the javascript learns that the user is logged in, it should try to reload.
I agree there are cases where a full page reload is not necessary. Here's what I would recommend as a workaround. Create your own module, let's call it custom.module and have that module call drupal_add_js() to load custom.js. In custom.js define Drupal.behaviors.custom something like this...
This will completely replace modules/fb handling of the session change with Custom.sessionChangeHandler(), which in the example above does nothing.
Comment #6
Dave Cohen commentedSo, I recently learned that appending the user id to the url is a Bad Thing. I'm planning to get some change in the next release. Probably some combination of this patch and also change exactly what gets appended to the URL, maybe a hash of the id.
I wish I could remember exactly the problem I solved with this. Probably one of those situations where third-party cookies are disabled.
Comment #7
Dave Cohen commentedOk, here's the patch I'm planning to test on drupalforfacebook.org.
Instead of appending the user's ID, it will append a hash value.
Instead of enabled by default, it will be disabled. Its ugly, both the code and what it does to the URLs. So I hope eventually to get rid of this entirely. But there was a reason to add it in the first place so let's see whether anyone encounters problems without it.
Thanks again for your help with the original patch submission.
Comment #8
Dave Cohen commentedI did check this in. Re-open if still an issue.
Comment #9
maciej lukianski commentedIt seems to be working on my installation. I am releasing it on my users today due to #1225830: Email from Facebook, "Action Required for app" and will see what happens.
Comment #10
Anonymous (not verified) commentedUpdated both our dev and production servers today from 6.x-3.0-rc8 to 6.x-3.0-rc15, and am no longer seeing the "?_fb_js_fbu" parameter being appended to the URL.
The reason I upgraded was not an email from Facebook or caching but because there was an issue on our pages that used Facebook Connect. Users who were logged into Facebook and who had already connected to our app were temporarily seeing the message that non-connected users saw before the page refreshed with the correct Facebook information. Dave, I think you mentioned this is the correct behavior, but I think Facebook's servers are running slow, so this became more visible (never saw this before this week). I think it might also be related to the Facebook JavaScript OAuth 2.0 update (http://developers.facebook.com/blog/post/525/) that was released late last week. I watched the timeline on Chrome and noticed that the page was taking almost 3-4 seconds on Facebook's all.js before the upgrade.
Anyways updating to rc15 helped the issue. Dave, thanks so much for actively maintaining this module!