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.
Watermark works only with English language. When you make use of the Locale module and switch to another language (e.g. German) it wont work.
Because $size['label'] (on code line 141) holds the translated string and not the array-key defined by image module.
Fix suggestion:
replace following code in watermark.module (line 140 to 152):
foreach (_image_get_sizes() as $size) {
$label_list[] = $size['label'];
}
$label_list[] = IMAGE_ORIGINAL;
foreach ($label_list as $label) {
$label_var = WATERMARK . $label;
$form['watermark']['labels'][$label_var] = array(
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => variable_get($label_var, false),
);
}
with:
foreach (_image_get_sizes() as $key => $size) {
$label_list[$key] = $size['label'];
}
foreach ($label_list as $key => $label) {
$label_var = WATERMARK . $key;
$form['watermark']['labels'][$label_var] = array(
'#type' => 'checkbox',
'#title' => $label,
'#default_value' => variable_get($label_var, false),
);
}
Comments
Comment #1
schnizZzla CreditAttribution: schnizZzla commentedOK i understand. I created the last dev version of watermark to use it on a german website ;-) We also use the locale module, that's why I changed the title.
To have an overview of issues for the next version, please give me your drupal and image module version here.
Comment #2
jack13 CreditAttribution: jack13 commentedsorry, I forgot
Drupal Version 5.3
Image Module Version 5.x-1.6
Image Watermark Version 5.x-1.x-dev