View Issue Details

IDProjectCategoryView StatusLast Update
0004829mantisbtbugtrackerpublic2004-12-11 03:01
Reporterpolzin Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.1 
Fixed in Version0.19.2 
Summary0004829: 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
Line: 52

Variable Value Type
p_user_id 3 string
p_trigger_errors 1 string
c_user_id 3 string
t_user_table mantis_user_table string
query SELECT * FROM mantis_user_table WHERE id='3' string

/srv/www/htdocs/mantis_next/core/user_api.php 52 trigger_error ( '801', 256 )
/srv/www/htdocs/mantis_next/core/user_api.php 498 user_cache_row ( '3' )
/srv/www/htdocs/mantis_next/core/user_api.php 509 user_get_row ( '3' )
/srv/www/htdocs/mantis_next/bugnote_view_inc.php 115 user_get_field ( '3', 'enabled' )
/srv/www/htdocs/mantis_next/bug_view_page.php 396 include ( '/srv/www/htdocs/mantis_next/bugnote_view_inc.php' )
/srv/www/htdocs/mantis_next/view.php 23 include ( '/srv/www/htdocs/mantis_next/bug_view_page.php' )

TagsNo tags attached.

Relationships

child of 0004818 closedvboctor Mantis 0.19.2 release 

Activities

polzin

polzin

2004-11-08 05:16

reporter   ~0008279

Last edited: 2004-11-08 05:44

I am not an PHP expert, but I can imagine a fix:

<pre>
diff -r1.1.1.4 bugnote_view_inc.php
115c115,116
< <?php if ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) {

  &lt;?php if ( FALSE == user_cache_row( $v3_reporter_id, FALSE ) ||
               FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) {

</pre>

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.

2004-11-22 07:56

 

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">';
4829.diff (872 bytes)   
vboctor

vboctor

2004-11-22 07:57

manager   ~0008391

Fixed in CVS and patch attached.

polzin

polzin

2004-11-22 10:20

reporter   ~0008395

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:
<pre>
if ( ! user_exists( $v3_reporter_id ) || ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) ) {
</pre>

and not

<pre>
if ( user_exists( $v3_reporter_id ) && ( FALSE == user_get_field( $v3_reporter_id, 'enabled' ) ) ) {
</pre>

vboctor

vboctor

2004-11-30 06:13

manager   ~0008452

Fixed 4829: bugnotes of deleted users cause error

  • Added prepare_api.php and implemented a couple of APIs that return info as strings rather than the corresponding apis in print_api which prints them. The print_apis now uses prepare_apis.
  • Moved the strike through formatting to inside the prepare_user_name().
  • Changed print_bugnote_inc.php, monitor list, relationship list, reporter, handler, bugnotes to all used the new method with the formatting.

Issue History

Date Modified Username Field Change
2004-11-08 05:09 polzin New Issue
2004-11-08 05:16 polzin Note Added: 0008279
2004-11-08 05:25 polzin Note Edited: 0008279
2004-11-08 05:44 polzin Note Edited: 0008279
2004-11-22 07:56 vboctor File Added: 4829.diff
2004-11-22 07:56 vboctor Assigned To => vboctor
2004-11-22 07:57 vboctor Status new => resolved
2004-11-22 07:57 vboctor Fixed in Version => 0.19.2
2004-11-22 07:57 vboctor Resolution open => fixed
2004-11-22 07:57 vboctor Note Added: 0008391
2004-11-22 08:10 vboctor Relationship added child of 0004818
2004-11-22 10:20 polzin Status resolved => feedback
2004-11-22 10:20 polzin Resolution fixed => reopened
2004-11-22 10:20 polzin Note Added: 0008395
2004-11-30 06:13 vboctor Status feedback => resolved
2004-11-30 06:13 vboctor Resolution reopened => fixed
2004-11-30 06:13 vboctor Note Added: 0008452
2004-12-11 03:01 vboctor Status resolved => closed