Hello!

We were using Drupal for Facebook 3.0, Facebook style-status 3.0 and FBSS to Facebook 3.x-dev and everything was working. But facebook changed something in their code and we upgraded Drupal fo Facebook to 3.1 version.
After that posting statuses to facebook had stop to work and we get Facebook::getSession error

Call to undefined method Facebook::getSession() in modules/fbss2fb/fbss2fb.module on line 131

Any suggestion?

Thank you!

CommentFileSizeAuthor
#1 fbss2fb-session-fix.patch432 bytespdumais42

Comments

pdumais42’s picture

StatusFileSize
new432 bytes

I had the same problem. getSession is not available in the Facebook PHP SDK v3.0. Here is the tech note: http://developers.facebook.com/blog/post/503/

I patched my copy of fbss2fb.module and it works for me again.

I will attach the patch file to this post. You can apply this patch with this command: patch -p0 < fbss2fb-session-fix.patch

If you want to edit by hand, here are the changes ...

Index: modules/fbss2fb/fbss2fb.module
===================================================================
112,115c112
< 
<        $fb_session = $fb->getSession();
<        $fb->api_client->session_key = $fb_session['session_key'];
<        $fb->api_client->expires = 0;
---
>        $fbu = $fb->getUser();
119c116
<            'session_key' => $fb_session['session_key'],
---
>            'access_token' => fb_get_token($fb, $fbu),
brentratliff’s picture

pdumais42,

Thanks for the patch. Looks strait forward. I'm applying and testing. If anyone else can verify it, I'll go ahead and commit it.

shellbot’s picture

Patch worked brilliantly for me, much appreciated!

brentratliff’s picture

Ok, I'll commit it shortly. Thanks.

brentratliff’s picture

Status: Active » Needs work

Tested and commited patch:

6.x-3.x cedb5ee] Issue #1372874 by pdumais42: Updated Facebook Session call for 3.x SDK.
Author: pdumais42
1 files changed, 2 insertions(+), 4 deletions(-)

I'm releasing beta1 as a recommended release.

brentratliff’s picture

Status: Needs work » Closed (fixed)

Closing