Unable to delete account when they have a collection with a cover image

Bug #1940033 reported by Robert Lyon
10
This bug affects 2 people
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

Tags: bite-sized
Robert Lyon (robertl-9)
Changed in mahara:
status: New → Confirmed
importance: Undecided → High
milestone: none → 21.10.0
Revision history for this message
Robert Lyon (robertl-9) wrote :

Note: with testing check cover images on pages still works too

tags: added: bite-sized
Revision history for this message
Robert Lyon (robertl-9) wrote :

Leaving this here for Dianne to fix.

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
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11978

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11978
Committed: https://git.mahara.org/mahara/mahara/commit/d8efdf5a6bd6cc74daceb724884041ec3ae96d99
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit d8efdf5a6bd6cc74daceb724884041ec3ae96d99
Author: Dianne Tennent <email address hidden>
Date: Wed Sep 8 14:30:20 2021 +1200

Bug 1940033: Now able to delete an account when there is a cover image on a collection

Change-Id: Icc3a6aba4483137f18390b49976a1ffcabd7637a

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "21.04_STABLE" branch: https://reviews.mahara.org/11980

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "20.10_STABLE" branch: https://reviews.mahara.org/11981

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11982

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11982
Committed: https://git.mahara.org/mahara/mahara/commit/48a1a8a3eebd4d1aa4eb8118b52ed993b0ea2ea8
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit 48a1a8a3eebd4d1aa4eb8118b52ed993b0ea2ea8
Author: Dianne Tennent <email address hidden>
Date: Wed Sep 8 14:30:20 2021 +1200

Bug 1940033: Now able to delete an account when there is a cover image on a collection

Change-Id: Icc3a6aba4483137f18390b49976a1ffcabd7637a
(cherry picked from commit d8efdf5a6bd6cc74daceb724884041ec3ae96d99)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11980
Committed: https://git.mahara.org/mahara/mahara/commit/5c513a7d053bfab15047b309f1e82c374977c371
Submitter: Robert Lyon (<email address hidden>)
Branch: 21.04_STABLE

commit 5c513a7d053bfab15047b309f1e82c374977c371
Author: Dianne Tennent <email address hidden>
Date: Wed Sep 8 14:30:20 2021 +1200

Bug 1940033: Now able to delete an account when there is a cover image on a collection

Change-Id: Icc3a6aba4483137f18390b49976a1ffcabd7637a
(cherry picked from commit d8efdf5a6bd6cc74daceb724884041ec3ae96d99)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11981
Committed: https://git.mahara.org/mahara/mahara/commit/ca64853d2aa9c330f00de8c6e98c1d4df7d49d8c
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.10_STABLE

commit ca64853d2aa9c330f00de8c6e98c1d4df7d49d8c
Author: Dianne Tennent <email address hidden>
Date: Wed Sep 8 14:30:20 2021 +1200

Bug 1940033: Now able to delete an account when there is a cover image on a collection

Change-Id: Icc3a6aba4483137f18390b49976a1ffcabd7637a
(cherry picked from commit d8efdf5a6bd6cc74daceb724884041ec3ae96d99)

no longer affects: mahara/21.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.