Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0003467mantisbtbugtrackerpublic2004-02-06 16:16
Reportervboctor Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.18.0 
Summary0003467: Delete user ends up at user not found error
Description

This bug was reported by Christian Hack [christianh@pdd.edmi.com.au] on mantisbt-help mailing list.

Using Mantis 0.18.0 release version when I delete a user, rather than returning to the manage user screen, I get APPLICATION ERROR 0000801 "User not found"

I have been playing with the user table a little to get a real name feature added (patch to come soon) but I am quite certain I haven't botched anything.

This is the sequence of SQL commands I am getting according to the debug info. You can see it deletes the user and then immediately searches for the same user in steps 5 through 7.

Any ideas?

Additional Information

1 SELECT id FROM mantis_user_table WHERE cookie_string='MN91uSF/JIhos8bcda8acc2ead8d60749ad019e56b54fadkPGTyoBgNB
Qf91563'
2 SELECT FROM mantis_user_table WHERE id='1'
3 SELECT DISTINCT language FROM mantis_user_pref_table p, mantis_user_table u WHERE u.cookie_string='MN91uSF/JIhos8bcda8acc2ead8d60749ad019e56b54fadkPGTyoBg
NBQf91563' AND u.id=p.user_id
4 SELECT
FROM mantis_user_table WHERE id='8'
5 DELETE FROM mantis_user_table WHERE id='8'
6 DELETE FROM mantis_user_profile_table WHERE user_id='8'
7 SELECT FROM mantis_user_table WHERE id='8'
8 SELECT
FROM mantis_project_table WHERE id='3'
9 SELECT project_id, access_level FROM mantis_project_user_list_table WHERE user_id='1'
10 SELECT DISTINCT( id ) FROM mantis_project_table WHERE enabled=1 ORDER BY name
11 SELECT FROM mantis_project_table WHERE id='1'
12 SELECT
FROM mantis_project_table WHERE id='2'
13 SELECT DISTINCT( id ) FROM mantis_project_table WHERE enabled=1 ORDER BY name
14 UPDATE mantis_user_table SET last_visit=NOW() WHERE id='1'

TagsNo tags attached.
Attached Files
3467_delete_user_error.diff (984 bytes)   
Index: core/user_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/user_api.php,v
retrieving revision 1.62
diff -u -r1.62 user_api.php
--- core/user_api.php	20 Nov 2003 10:38:07 -0000	1.62
+++ core/user_api.php	17 Dec 2003 22:14:32 -0000
@@ -366,14 +366,6 @@
 
 		user_ensure_unprotected( $p_user_id );
 
-		$t_user_table 				= config_get('mantis_user_table');
-
-		# Remove account
-		$query = "DELETE
-				  FROM $t_user_table
-				  WHERE id='$c_user_id'";
-		db_query( $query );
-
 		# Remove associated profiles
 		user_delete_profiles( $p_user_id );
 
@@ -384,6 +376,14 @@
 		user_delete_project_specific_access_levels( $p_user_id );
 
 		user_clear_cache( $p_user_id );
+
+		$t_user_table 				= config_get('mantis_user_table');
+
+		# Remove account
+		$query = "DELETE
+				  FROM $t_user_table
+				  WHERE id='$c_user_id'";
+		db_query( $query );
 
 		return true;
 	}
3467_delete_user_error.diff (984 bytes)   

Relationships

has duplicate 0003508 closedvboctor Error 0000801 when deleting user 

Activities

vboctor

vboctor

2003-12-17 23:21

manager   ~0004824

Fixed in CVS, and will be included in next release.

Related Changesets

MantisBT: master 97685a6d

2003-12-17 17:20

vboctor


Details Diff
Fix 0003467: Delete user ends up at user not found error.

M core/user_api.php
- (user_delete): Delete user record after deleting all its related records (eg: preferences, ...etc). This is due to user_pref_delete() checking the user table to see if it is projected.

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