Deleting an institution which has user's registrations causes error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Son Nguyen | ||
1.10 |
Fix Released
|
High
|
Son Nguyen | ||
1.7 |
Fix Released
|
High
|
Robert Lyon | ||
1.8 |
Fix Released
|
High
|
Robert Lyon | ||
1.9 |
Fix Released
|
High
|
Robert Lyon |
Bug Description
Version: master(1.10)
Platform: all
When deleting an institution which contains some registrations, I got the following error:
[WAR] a6 (lib/errors.
DETAIL: Key (name)=(instone) is still referenced from table "usr_registrati
Command was: DELETE FROM "institution" WHERE "name" = ? and values was (instone)
Call stack (most recent first):
log_message("Failed to get a recordset: postgres7 error: [-1: E...", 8, true, true) at /home/sonn/
log_warn("Failed to get a recordset: postgres7 error: [-1: E...") at /home/sonn/
SQLException-
delete_
delete_
call_user_
Pieform-
Pieform:
pieform(array(size 2)) at /home/sonn/
[WAR] a6 (lib/dml.php:925) Failed to get a recordset: postgres7 error: [-1: ERROR: update or delete on table "institution" violates foreign key constraint "usrregi_ins_fk" on table "usr_registration"
DETAIL: Key (name)=(instone) is still referenced from table "usr_registrati
Command was: DELETE FROM "institution" WHERE "name" = ? and values was (instone)
Call stack (most recent first):
delete_
delete_
call_user_
Pieform-
Pieform:
pieform(array(size 2)) at /home/sonn/
Changed in mahara: | |
assignee: | nobody → Son Nguyen (ngson2000) |
status: | New → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
milestone: | 1.10.0 → none |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
the patch https:/ /reviews. mahara. org/3306 also fixes other issues when deleting an institution:
1. Remove all institution collections
2. Remove all institution custom layouts
3. Remove all institution registrations