← Back to team overview

mahara-contributors team mailing list archive

[Bug 1988005] Re: Groups containing collections with cover images cannot be deleted

 

This issue doesn't happen on a page with a cover image but only when the
cover image is on a collection. The error message is the following:

[WAR] 7e (lib/errors.php:852) Failed to get a recordset: postgres9 error: [-1: ERROR:  update or delete on table "artefact" violates foreign key constraint "coll_cov_fk" on table "collection"
DETAIL:  Key (id)=(14) is still referenced from table "collection".] in EXECUTE("DELETE FROM "artefact" WHERE id IN (14)")Command was: DELETE FROM "artefact" WHERE id IN (14)
Call stack (most recent first):

    log_message("Failed to get a recordset: postgres9 error: [-1: E...", 8, true, true) at /home/kristina/code/mahara/htdocs/lib/errors.php:89
    log_warn("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/errors.php:852
    SQLException->__construct("Failed to get a recordset: postgres9 error: [-1: E...") at /home/kristina/code/mahara/htdocs/lib/dml.php:1154
    delete_records_sql("DELETE FROM "artefact" WHERE id IN (14)", null) at /home/kristina/code/mahara/htdocs/lib/dml.php:1063
    delete_records_select("artefact", "WHERE id IN (14)") at /home/kristina/code/mahara/htdocs/artefact/lib.php:871
    ArtefactType::_delete_dbrecords(array(size 1)) at /home/kristina/code/mahara/htdocs/artefact/lib.php:822
    ArtefactType::bulk_delete(array(size 1), true) at /home/kristina/code/mahara/htdocs/artefact/file/lib.php:1600
    ArtefactTypeFile::bulk_delete(array(size 1)) at /home/kristina/code/mahara/htdocs/artefact/file/lib.php:2584
    ArtefactTypeImage::bulk_delete(array(size 1)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:1928
    call_static_method("ArtefactTypeImage", "bulk_delete", array(size 1)) at /home/kristina/code/mahara/htdocs/artefact/lib.php:796
    ArtefactType::delete_by_artefacttype(array(size 2)) at /home/kristina/code/mahara/htdocs/lib/group.php:1043
    group_delete(2) at /home/kristina/code/mahara/htdocs/group/delete.php:62
    deletegroup_submit(object(Pieform), array(size 2)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:577
    Pieform->__construct(array(size 5)) at /home/kristina/code/mahara/htdocs/lib/pieforms/pieform.php:173
    Pieform::process(array(size 5)) at /home/kristina/code/mahara/htdocs/lib/mahara.php:5757
    pieform(array(size 5)) at /home/kristina/code/mahara/htdocs/group/delete.php:42

Steps to replicate:

1. Set up a group.
2. Create a page.
3. Create a collection and add a cover image.
4. Delete the group.

Results:
- Expected: The group can be deleted.
- Actual: The above error message is displayed.

** Also affects: mahara/22.04
   Importance: Undecided
       Status: New

** Also affects: mahara/22.10
   Importance: Medium
     Assignee: Fergus Whyte (fergusw)
       Status: New

** Also affects: mahara/21.04
   Importance: Undecided
       Status: New

** Also affects: mahara/21.10
   Importance: Undecided
       Status: New

** Changed in: mahara/22.10
       Status: New => In Progress

** Changed in: mahara/22.04
       Status: New => Confirmed

** Changed in: mahara/21.10
       Status: New => Confirmed

** Changed in: mahara/21.04
       Status: New => Confirmed

** Changed in: mahara/22.04
   Importance: Undecided => Medium

** Changed in: mahara/21.10
   Importance: Undecided => Medium

** Changed in: mahara/21.04
   Importance: Undecided => Medium

** Changed in: mahara/22.10
    Milestone: None => 22.10.0

** Changed in: mahara/22.04
    Milestone: None => 22.04.3

** Changed in: mahara/21.10
    Milestone: None => 21.10.5

** Changed in: mahara/21.04
    Milestone: None => 21.04.7

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1988005

Title:
  Groups containing collections with cover images cannot be deleted

Status in Mahara:
  In Progress
Status in Mahara 21.04 series:
  Confirmed
Status in Mahara 21.10 series:
  Confirmed
Status in Mahara 22.04 series:
  Confirmed
Status in Mahara 22.10 series:
  In Progress

Bug description:
  Attempting to delete a Group containing one or more collections with
  cover images set cannot be deleted due to a foreign key relation
  between collection and artifact for the "coverimage".

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1988005/+subscriptions



References