Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0008044mantisbtbugtrackerpublic2007-12-21 23:16
Reportera_crossley Assigned Togiallu  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version1.1.0Fixed in Version1.1.0a4 
Summary0008044: Edit/Delete bugnote buttons missing
Description

The Edit and Delete bugnote buttons (links in older versions) do not appear when update_bugnote_threshold and delete_bugnote_threshold are set.

This is an bug in the code in bugnote_view_inc.php which does not even reference these options. From the existing code I do not believe that it would correctly observe any config table options either.

This issue has been around since at least 0.19.2. See bug 0003096. It is still present in 1.0.6 and in CVS.

Steps To Reproduce
  1. set $g_update_bugnote_threshold = developer.
  2. Go to a bug and see if you have the edit option for someone else's bugnote.
Additional Information

My fix for this issue is:

diff -u mantis-1.0.6/bugnote_view_inc.php:1.1 mantis-1.0.6/bugnote_view_inc.php:1.3
--- mantis-1.0.6/bugnote_view_inc.php:1.1 Thu Feb 22 10:00:17 2007
+++ mantis-1.0.6/bugnote_view_inc.php Fri Jun 8 12:21:59 2007
@@ -131,6 +131,8 @@
<?php

only admins and the bugnote creator can edit/delete this bugnote

         # bug must be open to be editable
  • users above update_bugnote_threshold should be able to edit this bugnote

  • users above delete_bugnote_threshold should be able to delete this bugnote

         if ( !bug_is_readonly( $f_bug_id ) ) {
             if ( ( access_has_bug_level( config_get( 'manage_project_threshold' ), $f_bug_id ) ) ||
                 ( ( $v3_reporter_id == $t_user_id ) && ( ON == config_get( 'bugnote_allow_user_edit_delete' ) ) ) ) {

    @@ -144,7 +146,14 @@
    print_button('bugnote_set_view_state.php?private=1&bugnote_id='.$v3_id, lang_get( 'make_private' ));
    }
    }

  • }
  • } else {
  • if ( access_has_bug_level( config_get( 'update_bugnote_threshold' ), $f_bug_id ) ) {
  • print_button( 'bugnote_edit_page.php?bugnote_id='.$v3_id, lang_get( 'bugnote_edit_link' ) );
  • }
  • if ( access_has_bug_level( config_get( 'delete_bugnote_threshold' ), $f_bug_id ) ) {
  • print_button( 'bugnote_delete.php?bugnote_id='.$v3_id, lang_get( 'delete_link' ) );
  • }
  • }
    }
    ?>
    </span>
TagsNo tags attached.
Attached Files
bug8044.patch (2,611 bytes)   
Index: bugnote_view_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bugnote_view_inc.php,v
retrieving revision 1.38
diff -u -r1.38 bugnote_view_inc.php
--- bugnote_view_inc.php	20 Feb 2007 05:49:00 -0000	1.38
+++ bugnote_view_inc.php	29 Jun 2007 09:38:10 -0000
@@ -140,23 +140,41 @@
 		?>
 		<br /><span class="small">
 		<?php
-			# only admins and the bugnote creator can edit/delete this bugnote
 			# bug must be open to be editable
 			if ( !bug_is_readonly( $f_bug_id ) ) {
+			
+				$t_can_edit_note = false;
+				$t_can_delete_note = false;
+				# admins and the bugnote creator can edit/delete this bugnote
 				if ( ( access_has_bug_level( config_get( 'manage_project_threshold' ), $f_bug_id ) ) ||
 					( ( $v3_reporter_id == $t_user_id ) && ( ON == config_get( 'bugnote_allow_user_edit_delete' ) ) ) ) {
+					$t_can_edit_note = true;
+					$t_can_delete_note = true;
+				}
+				
+				# users above update_bugnote_threshold should be able to edit this bugnote
+				if ( $t_can_edit_note || access_has_bug_level( config_get( 'update_bugnote_threshold' ), $f_bug_id ) ) {			
 					print_button( 'bugnote_edit_page.php?bugnote_id='.$v3_id, lang_get( 'bugnote_edit_link' ) );
+				}
+				
+				# users above delete_bugnote_threshold should be able to delete this bugnote
+				if ( $t_can_delete_note || access_has_bug_level( config_get( 'delete_bugnote_threshold' ), $f_bug_id ) ) {
+				    echo " ";
 					print_button( 'bugnote_delete.php?bugnote_id='.$v3_id, lang_get( 'delete_link' ) );
-					if ( access_has_bug_level( config_get( 'private_bugnote_threshold' ), $f_bug_id ) &&
-						access_has_bug_level( config_get( 'change_view_status_threshold' ), $f_bug_id ) ) {
-						if ( VS_PRIVATE == $v3_view_state ) {
-							print_button('bugnote_set_view_state.php?private=0&amp;bugnote_id='.$v3_id, lang_get( 'make_public' ));
-						} else {
-							print_button('bugnote_set_view_state.php?private=1&amp;bugnote_id='.$v3_id, lang_get( 'make_private' ));
-						}
+				}
+				
+				if ( access_has_bug_level( config_get( 'private_bugnote_threshold' ), $f_bug_id ) &&
+					access_has_bug_level( config_get( 'change_view_status_threshold' ), $f_bug_id ) ) {
+					if ( VS_PRIVATE == $v3_view_state ) {
+					    echo " ";
+						print_button('bugnote_set_view_state.php?private=0&amp;bugnote_id='.$v3_id, lang_get( 'make_public' ));
+					} else {
+					    echo " ";
+						print_button('bugnote_set_view_state.php?private=1&amp;bugnote_id='.$v3_id, lang_get( 'make_private' ));
 					}
 				}
 			}
+				
 		?>
 		</span>
 	</td>
bug8044.patch (2,611 bytes)   

Relationships

has duplicate 0003096 closedgiallu Edit / Delete bug notes 
related to 0008122 closedgiallu Port 8044: Edit/Delete bugnote buttons missing 

Activities

a_crossley

a_crossley

2007-06-11 03:05

reporter   ~0014741

Sure this is a duplicate of 003096 but if so 3096 needs to be 'minor' not 'feature' and should at least now be at the 'acknowledged' stage. These are most likely hangovers from the original issue in 003096 which was more of an assistance request than a bug report. Hence why I raised a separate issue here.

giallu

giallu

2007-06-29 05:41

reporter   ~0014835

Ok. I took your input and slightly reworked the proposed patch to better suit my code taste ;)

see attached patch.

I also tested the results in a local installation and it looks fine; please feel free to review it and let me know if it does work for you

a_crossley

a_crossley

2007-07-02 06:13

reporter   ~0014842

Works for me. Code more readable too ;)

giallu

giallu

2007-07-03 07:50

reporter   ~0014854

So I'm going to commit the patch.

Do you think it is worthwhile to port the issue ( and the patch ) to the 1.0.x branch?

a_crossley

a_crossley

2007-07-03 07:58

reporter   ~0014856

Certainly. It is also an issue in 1.0.6 which we have in use and was the version I tested your patch against. When I last checked it was also an issue in latest CVS so presumably the patch needs applying their also.

giallu

giallu

2007-07-03 08:38

reporter   ~0014857

Done in both branches

Related Changesets

MantisBT: master 3fab5ad0

2007-07-03 08:36

giallu


Details Diff
Fix 0008044: Edit/Delete bugnote buttons missing

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4400 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0008044
mod - bugnote_view_inc.php Diff File