Unable to delete account when they have a collection with a cover image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Dianne Tennent | ||
20.04 |
Fix Released
|
High
|
Unassigned | ||
20.10 |
Fix Released
|
High
|
Unassigned | ||
21.04 |
Fix Released
|
High
|
Unassigned |
Bug Description
We get ERROR: update or delete on table "artefact" violates foreign key constraint "coll_cov_fk" on table "collection"
To test:
1) New site
2) Log in as admin and create a new user
3) Masquerade as new user
4) add a page
5) add a collection and add a cover image to the collection
6) add page to collection
7) stop masquerading (be admin again)
8) click on the 'Suspend or delete this account' and chose delete account
Expected result account is deleted
Actual outcome get error
The problem is the coverimage artefact id is still in the collection table when we try to delete the artefact.
In the delete_user() function the deletion of artefacts happens before the deletion of collections
We should maybe try those the other way around
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → High |
milestone: | none → 21.10.0 |
summary: |
- Unable to delete user when they have a collection with a cover image + Unable to delete account when they have a collection with a cover image |
no longer affects: | mahara/21.10 |
Note: with testing check cover images on pages still works too