View Issue Details

IDProjectCategoryView StatusLast Update
0015761mantisbtemailpublic2022-12-24 04:59
Reporterphilippkitzberger Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Summary0015761: No email on status change with bugnote when user pref email_on_status = OFF
Description

When a user X has not set the email_on_status flag a status change doesn't result in an email to that user. I guess that's the intension behind this flag.

In many cases a "status changer" also leaves a bugnote with the same update. Then no email is sent to user X regardless of the users setting for email_on_bugnote.

Here's why.

bug_update.php:


224 # Add a bugnote if there is one
225 if ( false == $t_bug_note_set ) {
226 bugnote_add( $f_bug_id, $f_bugnote_text, $f_time_tracking, $f_private, 0, '', NULL, FALSE );
227 }
228
229 # Update the bug entry, notify if we haven't done so already
230 $t_bug_data->update( true, ( false == $t_notify ) );

Line 226 adds the bugnote but doesn't send an email due to the 8th parameter being FALSE!

Line 230 updates the bug itself.

core/bug_api.php->update(...):


if status has been changed
then call email_generic( $c_bug_id, $t_status, 'email_notification_title_for_statusbug' . $t_status );

This calls:

core/email_api.php->email_collect_recipients(...):


if $p_notify_type is undefined (a.k.a. status change)
and user has status_on_change = OFF
then drop him from list of receipients

TagsNo tags attached.

Relationships

has duplicate 0026701 closeddregad Notification of a note added is not received when the issue is updated 

Activities

dregad

dregad

2013-04-16 17:47

developer   ~0036620

Line 226 adds the bugnote but doesn't send an email due to the 8th parameter being FALSE!

IMO this works as designed, because otherwise we would potentially send 2 notifications for the same event. All mails are sent at the end of the update() method.

I guess you may have a point that no mail is sent in the case where we have status change + bugnote, because we consider that the status change event "overrides" (or includes) the bugnote event, or in other words that the note belongs to the status change.

I can't think of a clean way of addressing this issue with the current notification model without potentially sending 2 emails. If you have an idea on how to fix that, a patch would be welcome.