View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0004829 | mantisbt | bugtracker | public | 2004-11-08 05:09 | 2004-12-11 03:01 | 
| Reporter | polzin | Assigned To | vboctor | ||
| Priority | normal | Severity | minor | Reproducibility | always | 
| Status | closed | Resolution | fixed | ||
| Product Version | 0.19.1 | ||||
| Fixed in Version | 0.19.2 | ||||
| Summary | 0004829: bugnotes of deleted users cause error | ||||
| Description | when V0.19.1 is displaying a bugnote of a user that does not exist any longer, there is an error: Full path: .../mantis_next/core/user_api.php Variable    Value   Type /srv/www/htdocs/mantis_next/core/user_api.php   52  trigger_error   ( '801', 256 )  | ||||
| Tags | No tags attached. | ||||
| Attached Files |  4829.diff (872 bytes)   
 
Index: bugnote_view_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bugnote_view_inc.php,v
retrieving revision 1.22
diff -u -r1.22 bugnote_view_inc.php
--- bugnote_view_inc.php	5 Oct 2004 17:20:26 -0000	1.22
+++ bugnote_view_inc.php	22 Nov 2004 13:52:23 -0000
@@ -112,7 +112,8 @@
 <tr class="bugnote" name="<?php echo $v3_id ?>" id="<?php echo $v3_id ?>">
         <td class="<?php echo $t_bugnote_css ?>">
 		<span class="small">(<?php echo $t_bugnote_id_formatted ?>)</span><br />
-		<?php if ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) {
+		<?php
+			if ( user_exists( $v3_reporter_id ) && ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) ) {
 				echo '<font STYLE="text-decoration: line-through">';
 			} else {
 				echo '<font STYLE="text-decoration: none">';
 | ||||
| 
	 I am not an PHP expert, but I can imagine a fix: 
diff -r1.1.1.4 bugnote_view_inc.php 115c115,116 < <?php if ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) { 
 The mantis team should check if this test for deletion should go into user_is_enabled and if user_is_enabled should be used in bugnote_view_inc.  | 
|
| 
	 Fixed in CVS and patch attached.  | 
|
| 
	 I am not sure, but probably not existing users (e.g. "user3") are ment to be displayed with "line-through", too? In this case it should be: 
 and not 
  | 
|
| 
	 Fixed 4829: bugnotes of deleted users cause error 
  | 
|