Dependency Graph
View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008044 | mantisbt | bugtracker | public | 2007-06-08 07:35 | 2007-12-21 23:16 |
| Reporter | a_crossley | Assigned To | giallu | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Target Version | 1.1.0 | Fixed in Version | 1.1.0a4 | ||
| Summary | 0008044: 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 |
| ||||
| 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 only admins and the bugnote creator can edit/delete this bugnote
| ||||
| Tags | No 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&bugnote_id='.$v3_id, lang_get( 'make_public' ));
- } else {
- print_button('bugnote_set_view_state.php?private=1&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&bugnote_id='.$v3_id, lang_get( 'make_public' ));
+ } else {
+ echo " ";
+ print_button('bugnote_set_view_state.php?private=1&bugnote_id='.$v3_id, lang_get( 'make_private' ));
}
}
}
+
?>
</span>
</td>
| ||||
|
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. |
|
|
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 |
|
|
Works for me. Code more readable too ;) |
|
|
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? |
|
|
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. |
|
|
Done in both branches |
|
|
MantisBT: master 3fab5ad0 2007-07-03 08:36 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 | ||
related to
child of
duplicate of