I followed the Readme instructions in installing fb for Drupal, and I am trying to allow users to authenticate, so I enabled FB Connect along with the standard API and APP settings. I put in my correct API and secret app key, and I get the following error:

Recoverable fatal error: Object of class Facebook could not be converted to string in drupal_http_request() (line 883 of /hermes/web03/b497/moo.clguidecom/drupal-7.12/includes/common.inc).

It is referencing this line of code in my common.inc file:

 $request = $options['method'] . ' ' . $path . " HTTP/1.0\r\n";
  foreach ($options['headers'] as $name => $value) {
    $request .= $name . ': ' . trim($value) . "\r\n";
  } 

Any ideas on why this is happening, or if it will cause my connection to fail?

CommentFileSizeAuthor
#6 fb.admin_.inc-2012-03.20.patch83 bytesstefan lehmann

Comments

frichman’s picture

Title: Recoverable fatal error: Object of class Facebook could not be converted to string, and User Authentication Error » Recoverable fatal error: Object of class Facebook could not be converted to string
Component: Facebook Connect » Code
imoreno’s picture

I can confirm this is happening to me when i sync the app.

After saying that it looks like it is not effecting the auth process as it is working for me,
dave - can you take a look at that?

jaydublu’s picture

subscribe

mareks’s picture

Me too :(

Recoverable fatal error: Object of class Facebook could not be converted to string in drupal_http_request() (line 883 of /var/www/MYSITE/html/includes/common.inc).

Dave Cohen’s picture

This is because of a change to the fb_graph() function signature. I thought I fixed all the references.

Make sure you're using latest .dev build. And grep in code for calls to fb_graph(). If you have any where the third parameter is $fb, it has to change.

fb_graph($path, $params, $fb) becomes fb_graph($path, $params, 'GET', $fb) (or 'POST', sometimes).

Sorry to change an API, but I had to, to make timeline posts work.

stefan lehmann’s picture

StatusFileSize
new83 bytes

There is still one line in the latest Drupal 7 release of this module, which has a wrong signature.
In the file fb/fb.admin.inc in line 145 the parameter 'GET' has to be added before $fb.

See attached patch file.

edgarpe’s picture

I tested patch in #6 and it works for me, solved the problem.

edgarpe’s picture

Status: Active » Reviewed & tested by the community
imoreno’s picture

Status: Reviewed & tested by the community » Fixed

this issue is no longer exist with 4/4 last dev version.

Dave Cohen’s picture

Thanks. I did commit a fix for that last call to fb_graph.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.