I wasn't sure the best module to post this in so I'm posting it in both. If you're using D7 imagecache profiles (7.x-1.x-dev) (http://drupal.org/project/imagecache_profiles) and enable "drupal for facebook" connect module (7.x-3.x-dev) http://drupal.org/project/fb , all user pictures site wide (even those used in views) revert back to the default user picture size. Both modules work well by themselves, but when they are both enabled the user profile pictures from imagecache profiles do not work.

Both these modules are required for a site I'm building, so any hint at a fix or alternative solution would be amazing!.

thanks!

Comments

sol roth’s picture

Here is the link to the issue I posted in Drupal for Facebook Connect http://drupal.org/node/1122102.

andypost’s picture

Can you debug your code to find a reason?

sol roth’s picture

Upon further investigation it appears drupal for facebook connect is using the override function fb_connect_theme_user_picture_override and returning $orig;, Since this is a theme override function it takes precedence over everything and anything that acts on the preprocess_user_picture (which is used in imagecache profiles and other modules).

So it appears the issue is with the drupal for facebook connect.

/**
* Our replacement for theme('user_picture', ...)
*/
function fb_connect_theme_user_picture_override($variables) {
$account = $variables['account'];
// Markup without fb_connect.
$orig = theme('fb_connect_user_picture_orig', array('account' => $account));

// Respect Drupal's profile pic, if uploaded.
if (isset($account->picture) && $account->picture) {
return $orig;
}

if ($fbu = fb_get_object_fbu($account)) {
$output = theme('fb_user_picture', array(
'fbu' => $fbu,
'account' => $account,
'orig' => $orig,
));
}
else {
$output = $orig;
}
return $output;
}

What is the best approach to reconcile this? I could modify the function fb_connect_theme_user_picture_override and change it's output to something that would respect the re-sized user profile pic, that's simple. The harder question for me is how do I send the facebook profile picture to drupal? These may be better questions for the drupal for facebook issue, but it's good to have it here incase anyone else runs into the same issue. I'm going to attempt to write a simple module that at best will fix this issue, at worst just remove profile picture handling from facebook connect and just using it for login authenticatino, because imagecache profiles is an absolute necessity for my purposes.

andypost’s picture

Status: Active » Closed (works as designed)

Suppose better to fix this in FB module, because looking into this code I see that it does not respect core's way for user's pictures

Let's mark this fixed - bug actually in FB and no reason to duplicate issue