View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004856 | mantisbt | bugtracker | public | 2004-11-11 02:18 | 2004-12-11 03:02 |
Reporter | naib | Assigned To | vboctor | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.19.1 | ||||
Fixed in Version | 0.19.2 | ||||
Summary | 0004856: Close immediately doesn't | ||||
Description | I have customised the Mantis system to set $g_allow_close_immediately = ON. If I check the "Close immediately" checkbox when I'm resolving an issue, it doesn't close immediately, requiring me to close it explicitly. I'm pretty sure this worked in 0.19.0. | ||||
Tags | No tags attached. | ||||
Attached Files | 4856_4861.diff (3,581 bytes)
Index: bug_change_status_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_change_status_page.php,v retrieving revision 1.10 diff -u -r1.10 bug_change_status_page.php --- bug_change_status_page.php 8 Oct 2004 18:57:51 -0000 1.10 +++ bug_change_status_page.php 22 Nov 2004 12:55:05 -0000 @@ -112,7 +112,7 @@ <!-- Custom Fields --> <?php $t_custom_status_label = "update"; # default info to check -if ( ( $f_new_status == config_get( 'bug_resolved_status_threshold' ) ) && +if ( ( $f_new_status == $t_resolved ) && ( CLOSED > $f_new_status ) ) { $t_custom_status_label = "resolved"; } Index: bug_update.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_update.php,v retrieving revision 1.77 diff -u -r1.77 bug_update.php --- bug_update.php 7 Nov 2004 23:18:49 -0000 1.77 +++ bug_update.php 22 Nov 2004 13:10:17 -0000 @@ -74,8 +74,10 @@ helper_call_custom_function( 'issue_update_validate', array( $f_bug_id, $t_bug_data, $f_bugnote_text ) ); + $t_resolved = config_get( 'bug_resolved_status_threshold' ); + $t_custom_status_label = "update"; # default info to check - if ( $t_bug_data->status == config_get( 'bug_resolved_status_threshold' ) ) { + if ( $t_bug_data->status == $t_resolved ) { $t_custom_status_label = "resolved"; } if ( $t_bug_data->status == CLOSED ) { @@ -118,7 +120,7 @@ # handle status transitions that come from pages other than bug_*update_page.php # this does the minimum to act on the bug and sends a specific message switch ( $t_bug_data->status ) { - case config_get( 'bug_resolved_status_threshold' ): + case $t_resolved: # bug_resolve updates the status and bugnote and sends message bug_resolve( $f_bug_id, $t_bug_data->resolution, $t_bug_data->fixed_in_version, $f_bugnote_text, $t_bug_data->duplicate_id, $t_bug_data->handler_id); @@ -128,6 +130,11 @@ if ( $f_close_now ) { bug_set_field( $f_bug_id, 'status', CLOSED ); } + + // update bug data with fields that may be updated inside bug_resolve(), otherwise changes will be overwritten + // in bug_update() call below. + $t_bug_data->handler_id = bug_get_field( $f_bug_id, 'handler_id' ); + $t_bug_data->status = bug_get_field( $f_bug_id, 'status' ); break; case CLOSED: @@ -135,14 +142,24 @@ bug_close( $f_bug_id, $f_bugnote_text ); $t_notify = false; $t_bug_note_set = true; + + // update bug data with fields that may be updated inside bug_resolve(), otherwise changes will be overwritten + // in bug_update() call below. + $t_bug_data->status = bug_get_field( $f_bug_id, 'status' ); + $t_bug_data->resolution = bug_get_field( $f_bug_id, 'resolution' ); break; case config_get( 'bug_reopen_status' ): - if ( $t_old_bug_status >= config_get( 'bug_resolved_status_threshold' ) ) { + if ( $t_old_bug_status >= $t_resolved ) { # bug_reopen updates the status and bugnote and sends message bug_reopen( $f_bug_id, $f_bugnote_text ); $t_notify = false; $t_bug_note_set = true; + + // update bug data with fields that may be updated inside bug_resolve(), otherwise changes will be overwritten + // in bug_update() call below. + $t_bug_data->status = bug_get_field( $f_bug_id, 'status' ); + $t_bug_data->resolution = bug_get_field( $f_bug_id, 'resolution' ); break; } # else fall through to default } | ||||