There is a problem with users pictures in comments. When i'm log in everything is ok. Unfortunately when i view my website as anonymous user pictures display incorrectly. Image below depicts the problem:

http://img825.imageshack.us/img825/7008/skrin3.jpg

Comments

komal.savla’s picture

Hi,

To fix this, remove if (isset($vars['user']->picture)) { from the following code in template.php :

<?php
/**
 * Additional comment variables
 */
function marinelli_preprocess_comment(&$vars) {
  $vars['classes_array'][] = $vars['zebra'];
  $user_image = array('width' => 0);
  if (isset($vars['user']->picture)) {         // Remove this line
    // No.. I don't use style 
    if(!variable_get('user_picture_style')){
      $size = variable_get('user_picture_dimensions');
      $size = explode('x',$size);
      $user_image['width'] = $size[0];
    }
    else{
      //Yes... I use style
      if ($picture = file_load($vars['comment']->picture->fid)) {
        $user_image = image_get_info(image_style_path(variable_get('user_picture_style'), $picture->uri));
      }
    }
     }    // Remove this line
  $vars['image_width'] = $user_image['width'] + 25;
}
?>

Thanks,
Komal

Lioz’s picture

Status: Active » Closed (duplicate)
Taress’s picture

Yes, sorry. This issue was already solved. http://drupal.org/node/1059664#comment-4257814