View Issue Details

IDProjectCategoryView StatusLast Update
0010294mantisbtbugtrackerpublic2009-06-23 15:28
Reporterbzz Assigned Tograngeway  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.6 
Fixed in Version1.2.0rc1 
Summary0010294: Bugnote add reads bug_readonly_status_threshold from current project not the bug's one
Description

If your current project is A and you are viewing a bug of project B, when you add a new bugnote, the readonly treshold is check against the A project not the B.

I think that other variables can be read from the other project(A) as well.

The printing of the textarea to add a bugnote is ok, it's checking the good project.

TagsNo tags attached.
Attached Files
bugnote.patch (1,357 bytes)   
--- bugnote_add.php~	2008-12-09 20:20:28.000000000 +0100
+++ bugnote_add.php	2009-04-06 21:23:22.000000000 +0200
@@ -37,6 +37,14 @@
 	$f_time_tracking	= gpc_get_string( 'time_tracking', '0:00' );
 	$f_bugnote_text	= trim( gpc_get_string( 'bugnote_text', '' ) );
 
+	
+	$t_bug = bug_get( $f_bug_id, true );
+	if( $t_bug->project_id != helper_get_current_project() ) {
+		# in case the current project is not the same project of the bug we are viewing...
+		# ... override the current project. This to avoid problems with categories and handlers lists etc.
+		$g_project_override = $t_bug->project_id;
+	}
+	
 	if ( bug_is_readonly( $f_bug_id ) ) {
 		error_parameters( $f_bug_id );
 		trigger_error( ERROR_BUG_READ_ONLY_ACTION_DENIED, ERROR );
@@ -44,12 +52,7 @@
 
 	access_ensure_bug_level( config_get( 'add_bugnote_threshold' ), $f_bug_id );
 
-	$t_bug = bug_get( $f_bug_id, true );
-	if( $t_bug->project_id != helper_get_current_project() ) {
-		# in case the current project is not the same project of the bug we are viewing...
-		# ... override the current project. This to avoid problems with categories and handlers lists etc.
-		$g_project_override = $t_bug->project_id;
-	}
+	
 
 	// We always set the note time to BUGNOTE, and the API will overwrite it with TIME_TRACKING
 	// if $f_time_tracking is not 0 and the time tracking feature is enabled.
bugnote.patch (1,357 bytes)   

Activities

bzz

bzz

2009-04-06 15:34

reporter   ~0021404

I've attached the patch, please check it, it works great, but I don't know if it's safe.

grangeway

grangeway

2009-04-14 12:50

reporter   ~0021528

Fix: 0010294: Bugnote add reads bug_readonly_status_threshold from current project not the bug's one

I think i'd agree with you on this - we should be checking bug_is_readyonly with the right of the project that bug is in.

Paul