The variable $alt is set in line 43 of the imagecache_profiles.module. But this means, that it is set only if the user has uploaded an own user-picture. If he hasn't and is using the default picture, the variable $alt is not set. Nonetheless it is used in lines 53 and 54.

My proposal is to take line 43 in front of line 42 and so to change the lines 42-56 from

    if ($account->picture && file_exists($account->picture)) {
      $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
      if (isset($size)) {
        $picture = theme('imagecache', $size, $account->picture, $alt, $alt);
      } else {
        $picture = theme('image', file_create_url($account->picture), $alt, $alt, '', FALSE);
      }
    } else if (variable_get('user_picture_default', '')) {
      $picture = variable_get('user_picture_default', '');
      if (isset($size)) {
        $picture = theme('imagecache', $size, $picture, $alt, $alt);
      } else {
        $picture = theme('image', file_create_url($picture), $alt, $alt, '', FALSE);
      }
    }

to

    $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));    
    if ($account->picture && file_exists($account->picture)) {
      if (isset($size)) {
        $picture = theme('imagecache', $size, $account->picture, $alt, $alt);
      } else {
        $picture = theme('image', file_create_url($account->picture), $alt, $alt, '', FALSE);
      }
    } else if (variable_get('user_picture_default', '')) {
      $picture = variable_get('user_picture_default', '');
      if (isset($size)) {
        $picture = theme('imagecache', $size, $picture, $alt, $alt);
      } else {
        $picture = theme('image', file_create_url($picture), $alt, $alt, '', FALSE);
      }
    }

Comments

andypost’s picture

Status: Needs review » Needs work

Please provide patch

andypost’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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