Facebook Connect Works! (With Gotchas)

user-pic
Vote 0  

Filed:

 
I have to give big thanks to three people: Tom Keating, Chris Hall, and Dan Wolfgang. Even though my PageRank has gone down considerably lately (I don't blog as much as I used to being one major problem in that department) Chris and Tom found my post about my problems with MT 4.23 and the beta Facebook Connect plugin.

I have been chatting with Dan recently as I have been using and testing some of his great plugins. He suggested I use a different Userpics template. The one that ships with MT 4.23 doesn't work for Facebook.
The moral of this story is to always compare your templates and modules with the latest versions. For main templates, this is easy, there is a repository for them. However there is not, and there should be, a place on MT.org for default template modules. For that I had to do a completely clean install of MT 4.23 with a new database to see the differences, which is likely why it took so long to track down the problem.

Credit goes to Tom for noticing two lines in my Sign In template module being wrong. The 4.2 Sign In code has this:

mtAttachEvent('load', mtUpdateSignInWidget);
mtAttachEvent('usersignin', mtUpdateSignInWidget);


And the 4.23 Sign In template module code is this:

mtAttachEvent('usersignin', mtUpdateSignInWidget);
mtUpdateSignInWidget();


Also Comments, Comments Detail, and Comments Form were slightly different, but the deal changer was the "load" event as it was conflicting with mt.js.

Six Apart, please publish the most up to date Default Template Modules on MT.org. PLEASE.

After fixing Sign In, Comments, Comments Form and Comments Detail, and rebuilding, I got a bunch of people to comment using Facebook. It worked most of the time. And I (and others) can see Sign In/Register on the Entry pages,

Gotcha #1) FB.Facebook.apiClient.get_session() is null still exists with no known fix at this time.

get_session is nullGotcha #2) Tom tells me the Sign In link still vanishes on my Entry pages. I have not tested this fully yet but I have not seen it vanish yet., thought it may in specific circumstances.

Gotcha #3) Something I might have been able to see had the Sign In link worked on my Entry pages before, but when you Sign Out, MT adds #_logout to the end of the URL. This makes all the Facebook profile pictures vanish, leaving the following:


Picture 23.png
However if you take out the #_logout and load the URL without that parameter, you see what you should, even when logged out:

Picture 21.pngBut Sign In now works, in theory, on the Entry pages. Is there still a bug in the beta Facebook Connect MT plugin? Is there a bug in Facebook Connect? Another thing to throw in here is this is not the first time I have read of onload events having conflicts with MT templates.

Below is what you need to get Facebook Connect working with MT 4.23. I cannot stress enough that I cannot take full credit for this, as it was entirely a group effort by putting four heads together.

  • You gotta have MT 4.23, so upgrade to it first.
  • Download and install Facebook Connect Commentors.
  • Download jQuery (not included, but required for FBC)
  • Download and install my five modified template modules.
  • Make sure all templates and template modules (Header, Simple Header, etc.) use xmlns:fb="http://www.facebook.com/2008/fbml" in the opening <HTML> tag. This makes IE happy.
  • Add jQuery before <mt:GreetFacebookCommenters> before </HEAD> and follow all other instructions in the README of Facebook Connect Commentors.
    • It takes a few days to a week for a new Facebook app to "register" with the system. You do not need to submit it for review, you just have to create it for the API and Secret Keys.
  • Rebuild
  • Profit?
You should now be where Tom and I are sitting, wondering what the FB.Facebook.apiClient.get_session() is null error is and why when you logout, Facebook profile pictures vanish. But this is miles ahead of where I was when Six Apart first released the Facebook Connect Commentors plugin and I started trying to set it up.

I am glad to say the only injuries sustained during the taping of this pilot episode was a minor headache by Tristan Blease, for he was staring at MT Javascript code the other night for far too long.

Email to a friend

2 Comments

| Leave a comment

Oh yea, I have not applied any of these changes to this Cutline template yet, so things may be wonky (but Facebook comments work, as you can see). I will do that later, it is time for food and sleep.

I am replying to my own comment just so I can test the template. More importantly I am doing testing on the mobile template ;)

Name and Email are required for anonymous comments. You can sign in to comment using Facebook, OpenID, and many other services. Register with BG Views to access community features.

Leave a comment

 Network Search
Custom Search

Poll

Do you like the toolbar at the bottom of this blog?

View results

View & Download PDF


View our support community!

About This Blog

Ken Edwards (and hopefully other project members) will be blogging here — a place to keep up on what is happening on the BG Views project. You will find bits of code, project updates, and random technical information aimed at confusing the hell out of you. More »

Subscriptions

Mobile Edition

Mobile EditionAccess the BG Views Developer Blog on your iPhone or other mobile device. Read more about our mobile site »
Powered by Movable Type 4.261

 

Also powered by:

  • Caffeine (Dr. Pepper)
  • Cup Cakes (Hostess)
  • Pizza (Pisanello's)