[I've read the whole readme file and ALL the good documentation on drupal.org, including Troubleshooting. Good stuff. Still grappling with a couple of issues but overall thanks for this great module! Below is a fix I'm proposing.]

Context: I'm displaying a list of recently created nodes by all site users in a view on the home page. Some are Drupal-only users, some are FacebookConnect users (with a local user created when approving my app). Since I don't want to display those annoying xxx@facebook names, I'm calling fb_format_username() for the FB users to get their FB names and display that instead. This works for the current user but not for other users, even though all these FB users have approved my app (otherwise they wouldn't be able to create these nodes to begin with).

It seems that the FQL query in fb_users_getInfo (fb.module line 1296, which is called by fb_format_username()) does not pass the needed authentication token. I saw another issue regarding fb_permissions and so added "array('access_token' => fb_get_token($fb))" as the third argument to to fb_fql_query(). This resolved the issue and now any user can see the names of all other users.

Furthermore, this change fixed another problem I had when, as an admin, I would go to edit a user that was created as a result of logging in via FBConnect. I used to receive multiple Drupal messages about invalid access tokens:
Failed to query facebook user info: Invalid OAuth 2.0 Access Token 190. (logged into facebook as )
That's no longer happening.

If it helps, you can see the site at http://geminsight.com/patternpaint. It's still in development but is accessible.

I'd appreciate if you can confirm that this fix is appropriate, especially from a privacy perspective. I think it is, but I've just started integrating with FB.

One last point: a comment in the source says that fb_users_getInfo() is deprecated. Obviously, fb_format_username() is still using it, but perhaps there are other places where a similar fix is needed?

Thanks,
Micah

CommentFileSizeAuthor
#2 fb-fb_users_getInfo_fql-1066486-2.patch672 bytesagileware

Comments

Dave Cohen’s picture

Micah,

Thanks for the fix. It sounds right and I've added it to my local copy. Will check in if I find no problems.

As you mention, that particular function is deprecated. But as long as some code still uses it, it might as well work!

-Dave

agileware’s picture

Version: 6.x-3.0-rc8 » 6.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new672 bytes

Here is a patch for what I believe was described in the original post.

I haven't enough knowledge of the fb module to give any sort of technical review but it fixed an error I was getting, which occurred when logging in to the drupal site when not logged into my facebook account.

For more info, in this case the fb_users_getInfo() function was called by the fb_user_get_proxied_email() function.

The error message was the same as describe by the original poster:

Failed to query facebook user info: Invalid OAuth 2.0 Access Token 190. (logged into facebook as )

Patch is for dev.