Skip to content

Commit

Permalink
Avoid blank notes on group resolve/close actions
Browse files Browse the repository at this point in the history
Fixes #26150

Signed-off-by: Victor Boctor <victor@mantishub.net>
  • Loading branch information
vboctor committed Dec 9, 2019
1 parent 35ef5a6 commit 89b5f4c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions core/bug_api.php
Expand Up @@ -1905,8 +1905,10 @@ function bug_close( $p_bug_id, $p_bugnote_text = '', $p_bugnote_private = false,
# Add bugnote if supplied ignore a false return
# Moved bugnote_add before bug_set_field calls in case time_tracking_no_note is off.
# Error condition stopped execution but status had already been changed
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
if( !is_blank( $p_bugnote_text ) || $p_time_tracking != '0:00' ) {
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
}

bug_set_field( $p_bug_id, 'status', config_get( 'bug_closed_status_threshold' ) );

Expand Down Expand Up @@ -1936,8 +1938,10 @@ function bug_resolve( $p_bug_id, $p_resolution, $p_fixed_in_version = '', $p_bug
# Add bugnote if supplied
# Moved bugnote_add before bug_set_field calls in case time_tracking_no_note is off.
# Error condition stopped execution but status had already been changed
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
if( !is_blank( $p_bugnote_text ) || $p_time_tracking != '0:00' ) {
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
}

$t_duplicate = !is_blank( $p_duplicate_id ) && ( $p_duplicate_id != 0 );
if( $t_duplicate ) {
Expand Down Expand Up @@ -2005,8 +2009,10 @@ function bug_reopen( $p_bug_id, $p_bugnote_text = '', $p_time_tracking = '0:00',
# Add bugnote if supplied
# Moved bugnote_add before bug_set_field calls in case time_tracking_no_note is off.
# Error condition stopped execution but status had already been changed
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
if( !is_blank( $p_bugnote_text ) || $p_time_tracking != '0:00' ) {
$t_bugnote_id = bugnote_add( $p_bug_id, $p_bugnote_text, $p_time_tracking, $p_bugnote_private, 0, '', null, false );
bugnote_process_mentions( $p_bug_id, $t_bugnote_id, $p_bugnote_text );
}

bug_set_field( $p_bug_id, 'status', config_get( 'bug_reopen_status' ) );
bug_set_field( $p_bug_id, 'resolution', config_get( 'bug_reopen_resolution' ) );
Expand Down

0 comments on commit 89b5f4c

Please sign in to comment.