When a user is deleted, deletion of notification_internal_activity
records can fail with a foreign key error when another row in
notification_internal_activity has a parent field pointing to one of
the records we are trying to delete. This is fixed by setting the
parent fields to null before deletion.
The handle_event('deleteuser') call in delete_user is also moved
inside the transaction, to ensure that deleted users will have their
notifications deleted correctly. Other subscribers to the deleteuser
event in core should be unaffected.
Change-Id: Ibc0a695e986bb175a00441f02d3e40abf38cbcde
Signed-off-by: Richard Mansfield <email address hidden>
Reviewed: https:/ /reviews. mahara. org/993 gitorious. org/mahara/ mahara/ commit/ 9bc9d15c2780e7b 12f49595a482d65 ed8cd76e53
Committed: http://
Submitter: Francois Marier (<email address hidden>)
Branch: master
commit 9bc9d15c2780e7b 12f49595a482d65 ed8cd76e53
Author: Richard Mansfield <email address hidden>
Date: Mon Jan 16 14:12:07 2012 +1300
Fix sql error in bulk user deletion (bug #916998)
When a user is deleted, deletion of notification_ internal_ activity n_internal_ activity has a parent field pointing to one of
records can fail with a foreign key error when another row in
notificatio
the records we are trying to delete. This is fixed by setting the
parent fields to null before deletion.
The handle_ event(' deleteuser' ) call in delete_user is also moved
inside the transaction, to ensure that deleted users will have their
notifications deleted correctly. Other subscribers to the deleteuser
event in core should be unaffected.
Change-Id: Ibc0a695e986bb1 75a00441f02d3e4 0abf38cbcde
Signed-off-by: Richard Mansfield <email address hidden>