From 173352bcc8974deb946781bd868cb928547fd0cf Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 23 Nov 2006 21:20:28 +0000 Subject: [PATCH] r1311: I always thought there was a bug in the email sending process for new comments; I guess I got that right. Fixed. --- docs/changes.txt | 1 + editreport.php | 3 +++ includes/class_notification.php | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 37008b7..41fffcf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -23,6 +23,7 @@ - Localized the version checking information strings in admin/index.php - Localized the word "Home" in the admin/index.php - Fixed a bug in admin/user.php where email options would be changed for the admin making the changes to another user's account instead of that user +- Emails weren't being sent under certain conditions for new comments 1.1.3 =============================== diff --git a/editreport.php b/editreport.php index ebfd880..dd12c4d 100644 --- a/editreport.php +++ b/editreport.php @@ -164,6 +164,8 @@ if ($_POST['do'] == 'update') $comment->set('comment', $commenttext); $comment->insert(); + // we redefine the bug data later, but it needs to be here in order to generate the user list + $notif->set_bug_data($bugapi->objdata); $notif->send_new_comment_notice($comment->values); $bugapi->set('lastposttime', $comment->values['dateline']); @@ -176,6 +178,7 @@ if ($_POST['do'] == 'update') if (!((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid']))) { $bugapi->update(); + $notif->finalize(); $message->redirect(_('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]"); } } diff --git a/includes/class_notification.php b/includes/class_notification.php index b7cb632..a875e89 100644 --- a/includes/class_notification.php +++ b/includes/class_notification.php @@ -153,6 +153,13 @@ class NotificationCenter */ function fetch_user_cache() { + // reset all the data each time we do this, just in case it changes within the lifespan of the object + $this->users = array(); + foreach ($this->roles AS $role => $users) + { + $this->roles["$role"] = array(); + } + $favorites = $this->registry->db->query("SELECT userid FROM " . TABLE_PREFIX . "favorite WHERE bugid = " . $this->registry->clean($this->bug['bugid'], TYPE_UINT)); while ($fav = $this->registry->db->fetch_array($favorites)) { -- 2.43.5