Skip to content

Commit

Permalink
Fix #12549: Bug change status form always creates private bug notes
Browse files Browse the repository at this point in the history
Due to invalid handling of boolean types and built in view state
constants, bug notes added via the bug change status form were ignoring
the "private" checkbox.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
  • Loading branch information
Tamás Gulácsi authored and davidhicks committed Feb 26, 2011
1 parent 08c027a commit 93b581b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bug_update.php
Expand Up @@ -123,7 +123,7 @@

$t_bug_note = new BugNoteData();
$t_bug_note->note = gpc_get_string( 'bugnote_text', '' );
$t_bug_note->view_state = gpc_get_bool( 'private', config_get( 'default_bugnote_view_status' ) );
$t_bug_note->view_state = gpc_get_bool( 'private', config_get( 'default_bugnote_view_status' ) == VS_PRIVATE ) ? VS_PRIVATE : VS_PUBLIC;
$t_bug_note->time_tracking = gpc_get_string( 'time_tracking', '0:00' );

# Determine whether the new status will reopen, resolve or close the issue.
Expand Down Expand Up @@ -358,7 +358,7 @@

# Add a bug note if there is one.
if ( $t_bug_note->note || helper_duration_to_minutes( $t_bug_note->time_tracking ) > 0 ) {
bugnote_add( $f_bug_id, $t_bug_note->note, $t_bug_note->time_tracking, $t_bug_note->view_state, 0, '', null, false );
bugnote_add( $f_bug_id, $t_bug_note->note, $t_bug_note->time_tracking, $t_bug_note->view_state == VS_PRIVATE, 0, '', null, false );
}

# Add a duplicate relationship if requested.
Expand Down

0 comments on commit 93b581b

Please sign in to comment.