View Issue Details

IDProjectCategoryView StatusLast Update
0012549mantisbtbugtrackerpublic2014-12-08 02:08
Reportergthomas Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.0dev 
Target Version1.3.0-beta.1 
Summary0012549: Changing status form always creates private note
Description

bug_change_status_page.php sets "private" form variable a boolean.
This goes to bug_update.php, where $t_bug_note->view_state is set - mistakenly with boolean (or with the default view state number), secondly bugnote_add is used to add the bugnote, with $t_bug_note->view_state used as $p_private argument.

Additional Information

Patch attached.

Tagspatch
Attached Files
bugnote-private.patch (1,505 bytes)   
commit 4dc516b10c20e57a17569b9277ca93aa5c222b58
Author: Gulacsi Tamas <tgulacsi@websrv.unosoft.dmz>
Date:   Sun Nov 21 11:39:08 2010 +0100

    fix bug_update error with adding bugnote (always private)

diff --git a/bug_update.php b/bug_update.php
index d47a39d..0842a7d 100644
--- a/bug_update.php
+++ b/bug_update.php
@@ -123,7 +123,7 @@ $t_updated_bug->view_state = gpc_get_int( 'view_state', $t_existing_bug->view_st
 
 $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.
@@ -355,7 +355,8 @@ foreach ( $t_custom_fields_to_set as $t_custom_field_to_set ) {
 
 # 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 );
+log_event(LOG_FILTERING, "bugnote_add($f_bug_id, ".$t_bug_note->view_state.')');
+	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.
bugnote-private.patch (1,505 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

dhx

dhx

2011-02-26 05:20

reporter   ~0028302

Committed. Thanks for the patch!

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036469

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 93b581bf

2011-02-26 05:15

gthomas

Committer: dhx


Details Diff
Fix 0012549: Bug change status form always creates private bug notes

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>
Affected Issues
0012549
mod - bug_update.php Diff File