After upgrading to 1.5.2 I noticed that I was no longer receiving emails whenever there were *other* changes. So I was receiving emails for picture comments, but NOT for other changes.
I think there's a small error in this code (from Album.php in the classes folder):
// send email
if ($gallery->app->emailOn == 'yes' && $success && $msg) {
if (!is_array($msg)) {
echo gallery_error(_("msg should be an array!"));
vd($msg);
return $success;
}
if (!empty($to)) {
$to = $this->getEmailMeList('other');
$text = '';
$msg_str = call_user_func_array('sprintf', $msg);
$subject = sprintf(_("Changes to Album: %s"), $this->fields['name']);
$logmsg = sprintf("Change to %s: %s.", makeAlbumHeaderUrl($this->fields['name']), $msg_str);
$text .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
$text .= "\n\n<html>";
$text .= "\n <head>";
$text .= "\n <title>$subject</title>";
$text .= "\n </head>\n<body>\n<p>";
$text .= sprintf(_("A change has been made to Album: %s by %s (IP %s). The change is: %s"),
'<a href="'. makeAlbumHeaderUrl($this->fields['name']) .'">'. $this->fields['name'] .'</a>',
$gallery->user->printableName($gallery->app->comments_display_name),
$_SERVER['REMOTE_ADDR'],
$msg_str);
$text .= "\n<p>". _("If you no longer wish to receive emails about this image, follow the links above and ensure that 'Email me when other changes are made' is unchecked (You'll need to login first).");
$text .= "\n</p>\n</body>\n</html>";
gallery_mail($to, $subject, $text, $logmsg, true, NULL, false, true);
} else if (isDebugging()) {
print "\n<br>". _("Operation was done successfully. Emailing is on, but no email was sent as no valid email address was found");
}
}
I've changed
if (!empty($to)) {
to
if (empty($to)) {
and then I started receiving these emails as well!
Posts: 6818
Hello,
thanks for the report. You found indeed a bug, but your fix is wrong.
Correct fix were to move:
$to = $this->getEmailMeList('other');
above the (correct)if (!empty($to)) {
Fixed in Gallery 1.5.3-cvs-b4
thanks,
Jens
--
Last Gallery v1 developer and translation manager.
Posts: 3
Thank you!