Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
andypostPlease provide patch
Comment #2
andyposthttp://drupal.org/cvs?commit=332150