I just upgraded from 6.x-2.0-rc2 to 6.x-3.0-beta1.

Now I am getting the following javascript error

Error: FB.XFBML is undefined
Source File: http:///modules/fb/fb.js?0
Line: 219

Also the "logout" link does not seem to be working. Not sure if it is related to the above problem

Comments

vivekwtv’s picture

So the javascript error was because of an older version of FB javascript getting included. I have fixed that.

However, the logout button is still not working. Clicking on the link just redirects to the homepage w/o logging out the user.

srjosh’s picture

Priority: Normal » Major

I am having the exact same issue.

I am not, as near as I can tell, loading an old version of the FB js; I'm loading the same version that came with the 6.x-3.x-dev version of the module. I've also tried the version of the fb.js file that came with fb-6.x-3.0-beta1.tar.gz, and it did not work.

Dave Cohen’s picture

Category: bug » support
Priority: Major » Normal

probably your browser's cache

srjosh’s picture

Uh... not so much. I've cleared the browser's cache, restarted both browser and computer, and am monitoring in firebug where it's coming in "200 OK", not "304 Not Modified". And used multiple different browsers.

Plus, I've checked the code as completely as I can, and the object being referenced isn't in there.

srjosh’s picture

Category: support » bug
Priority: Normal » Major
Dave Cohen’s picture

So the javascript error was because of an older version of FB javascript getting included. I have fixed that.

I am having the exact same issue.

I'm totally confused. I can't tell whether you two are reporting the same problem, or whether that problem is "FB.XFBML is undefined javascript error" as the title of this thread indicates.

srjosh’s picture

I am having the exact error reported in the issue. The OP vivekwtv later commented that he was using an old version of the JS, and updating it fixed that. I don't know if that means that vivekwtv replaced the JS in the module with JS from Facebook, or if he is saying that a fresh download of the module replaced the JS and fixed the problem.

Either way, I am experiencing the problem with both the latest dev from D.org and the current recommended version.

Your suggestion, that my browser was caching the JS, turned out not to be the case. So, either the module is shipping with bogus code files, or something very strange is going on, on my dev site.

Any more clear?

Dave Cohen’s picture

I suspect you have some old code somewhere, including facebook's older javascript. Both their old libraries and their new libraries define a global called FB. So if the old code is initializing it, FB.XFBML will be undefined.

I doubt it's a bug in modules/fb, I think you have old files lying around, or some other facebook module installed.

tatyana’s picture

Version: 6.x-3.0-beta1 » 6.x-3.0-beta3

Have the same issue with beta3 version.
FB.XFBML is undefined in fb.js live 220.
During debugging I have found out that http://connect.facebook.net/en_US/all.js is not loaded.

Dave Cohen’s picture

You have some module installed which loads the old facebook javascript. You can't mix both the old and new, because Facebook chose to set a global called "FB" in both versions.

If you want to use modules/fb 3.x, you need to find the module loading the old javascript and disable it.

srjosh’s picture

*sigh* You're right. It wasn't anywhere in the modules, it was in a block created by one of the editors, using an old version of the facebook "Like Box".

Updated that and we're in business.

Dave Cohen’s picture

Category: bug » support
Priority: Major » Normal

I assume everyone on this thread has something like that causing this.

srjosh’s picture

Status: Active » Closed (works as designed)