View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005969 | mantisbt | bugtracker | public | 2005-07-18 10:15 | 2005-09-11 08:13 |
Reporter | hgaland | Assigned To | thraxisp | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.0.0a3 | ||||
Fixed in Version | 1.0.0rc2 | ||||
Summary | 0005969: Incorrect recipients for notifications | ||||
Description | Let say:; Result: the notification are not sent according to the bug project's rules, but the default rules. | ||||
Tags | No tags attached. | ||||
Attached Files | Patch.txt (3,203 bytes)
--- email_api.php 1.0.0rc1 +++ email_api.php 2005-07-25 17:40:54.455671200 +0200 @@ -154,9 +154,9 @@ # For example, you can get the value associated with notifying "admin" # on action "new", i.e. notify administrators on new bugs which can be # ON or OFF. - function email_notify_flag( $action, $flag ) { - $t_notify_flags = config_get( 'notify_flags' ); - $t_default_notify_flags = config_get( 'default_notify_flags' ); + function email_notify_flag( $action, $flag, $p_project = null ) { + $t_notify_flags = config_get( 'notify_flags', null, null, $p_project ); + $t_default_notify_flags = config_get( 'default_notify_flags', null, null, $p_project ); if ( isset ( $t_notify_flags[$action][$flag] ) ) { return $t_notify_flags[$action][$flag]; } elseif ( isset ( $t_default_notify_flags[$flag] ) ) { @@ -174,25 +174,25 @@ $t_recipients = array(); + $t_project_id = bug_get_field( $p_bug_id, 'project_id' ); + # add Reporter - if ( ON == email_notify_flag( $p_notify_type, 'reporter' ) ) { + if ( ON == email_notify_flag( $p_notify_type, 'reporter', $t_project_id ) ) { $t_reporter_id = bug_get_field( $p_bug_id, 'reporter_id' ); $t_recipients[$t_reporter_id] = true; log_event( LOG_EMAIL_RECIPIENT, "bug= $p_bug_id, add reporter=$t_reporter_id" ); } # add Handler - if ( ON == email_notify_flag( $p_notify_type, 'handler' )) { + if ( ON == email_notify_flag( $p_notify_type, 'handler', $t_project_id )) { $t_handler_id = bug_get_field( $p_bug_id, 'handler_id' ); $t_recipients[$t_handler_id] = true; log_event( LOG_EMAIL_RECIPIENT, "bug= $p_bug_id, add handler=$t_handler_id" ); } - $t_project_id = bug_get_field( $p_bug_id, 'project_id' ); - # add users monitoring the bug $t_bug_monitor_table = config_get( 'mantis_bug_monitor_table' ); - if ( ON == email_notify_flag( $p_notify_type, 'monitor' ) ) { + if ( ON == email_notify_flag( $p_notify_type, 'monitor', $t_project_id ) ) { $query = "SELECT DISTINCT user_id FROM $t_bug_monitor_table WHERE bug_id=$c_bug_id"; @@ -213,7 +213,7 @@ $t_bug_date = bug_get_field( $p_bug_id, 'last_updated' ); $t_bugnote_table = config_get( 'mantis_bugnote_table' ); - if ( ON == email_notify_flag( $p_notify_type, 'bugnotes' ) ) { + if ( ON == email_notify_flag( $p_notify_type, 'bugnotes', $t_project_id ) ) { $query = "SELECT DISTINCT reporter_id FROM $t_bugnote_table WHERE bug_id = $c_bug_id"; @@ -229,8 +229,8 @@ # add project users who meet the thresholds $t_bug_is_private = bug_get_field( $p_bug_id, 'view_state' ) == VS_PRIVATE; - $t_threshold_min = email_notify_flag( $p_notify_type, 'threshold_min' ); - $t_threshold_max = email_notify_flag( $p_notify_type, 'threshold_max' ); + $t_threshold_min = email_notify_flag( $p_notify_type, 'threshold_min', $t_project_id ); + $t_threshold_max = email_notify_flag( $p_notify_type, 'threshold_max', $t_project_id ); $t_threshold_users = project_get_all_user_rows( $t_project_id, $t_threshold_min ); foreach( $t_threshold_users as $t_user ) { if ( $t_user['access_level'] <= $t_threshold_max ) { | ||||
I think that this is related to 0005432. The wrong default project was being picked up. This should be fixed now in CVS. Could you retest it? |
|
I imported all the modifications from CVS. The bug persists. The notifications are sent according to the rules of the selected project and not the rules set for the project of the bug. Sorry |
|
I Finaly found the bug.... Solution is in email_api.php The function email_notify_flag( $action, $flag ) should allow a third parameter for project_id (default == null) Callers in function email_collect_recipients should call the function with the third parameter I Attached the modified email_api.php file with a patch.txt file. You should be able to close the case when imported into CVS. Best regards |
|
Fixed email arising from new bugnotes and a number of other places where the wrong project might be used when the bug's project doesn't match the default. A more global approact to making the change was used rather than the contributed patch as it covers all reverences to configuration variables, not just the email. bug_assign_reporter.php -> 1.4 |
|
I Applied the corrections, ad still a problem. I afford in your comment, your correction is more accurate... but you forgot the bug_update.php
|
|
Added bug_update.php bug_update.php -> 1.87 |
|