Invalid uid for fb:profile_pic (0)
ryanwaggoner - December 8, 2007 - 00:09
| Project: | Drupal for Facebook |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I just installed and setup my first facebook app running on drupal. Everything seems to be working except for this error that appears at the bottom of the page:
fb:profile-pic: Invalid uid for fb:profile_pic (0)I uncommented the following line (64) in template.php:
//drupal_set_message("node vars: " . dprint_r($vars, 1));All I get is "node vars: " with no values displayed. Any ideas? Fantastic project, by the way!

#1
Also, my settings for facebook users are to create new drupal account for users who have added the app, which appears to be working. Also, if I go to "My Account" my Facebook profile pic appears as expected.
#2
Nevermind...it's because I created content from the Drupal side before I setup the facebook app, so it's displaying content from a non-facebook account and attempting to display the profile-pic for that user's facebook uid, which doesn't exist.
How would I not have the fb_fbml theme attempt to display a profile-pic if the user who posted a piece of content is not a facebook user? in other words, assuming that the application has two fronts, the facebook front and the normal web front, but I want content from both displayed on the facebook front, how do I have the theme differentiate so as to not try and display the profile-pic?
Thanks!
#3
It no longer tries to display a pic if the facebook user id is not known.
#4
Automatically closed -- issue fixed for two weeks with no activity.
#5
Dave, I'm actually running into that same error with my app that I just installed ... and I just updated my fb module to the dev release dated 12/12/07
#6
I am also seeing this. For me the issue appears to be that though the content was created by a facebook user, the user is no longer in the fb_user_app table, so the handler calls ends up getting "0" for the user id causing the described error. Not 100% sure why they are not in the fb_user_app table, my guess is that they have since uninstalled the application.
In any case, I updated the handler to return "" when this condition hits. I guess ideally that might be a theme-able so that folks could choose the empty text, image, etc when the profile pic is unknown.
function fb_views_handler_profile_pic($fieldinfo, $fielddata, $value, $data) {if ($value == 0) return '';
return '<div class="picture"><fb:profile-pic uid="'.$value.'" linked="yes" size="thumb" /></div>';
}