brustj / tracmor

Automatically exported from code.google.com/p/tracmor
GNU General Public License v2.0
0 stars 0 forks source link

Error when deleting a User Role that is currently assigned to a User #52

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a User Role
2. Create/Edit a User and assign them to the User Role you created.
3. Try to delete the User Role. 

What is the expected output? What do you see instead?
The expected output is a friendly message to the user letting them know
that this User Role cannot be deleted because there are users assigned to it.

Instead you receive an ugly error message:
MySqli Error: Cannot delete or update a parent row: a foreign key
constraint fails (`tracmor-dev/user_account`, CONSTRAINT
`user_account_ibfk_3` FOREIGN KEY (`role_id`) REFERENCES `role` (`role_id`)
ON DELETE NO ACTION ON UPDATE NO ACTION)

Original issue reported on code.google.com by jsincl...@gmail.com on 16 Jul 2008 at 7:56

GoogleCodeExporter commented 8 years ago
This issue is fixed.  You now receive the message "You cannot delete roles with
assigned user accounts." when attempting to delete a user role that is assigned 
to a
user.

Original comment by jsincl...@gmail.com on 16 Apr 2009 at 10:36