mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #67054
[Bug 1969693] Re: Error appears when deleting Institution collections that have been auto-copied to members accounts
Right now, the template is needed in case there are portfolios in the
queue that are waiting to be copied. portfolio_auto_copy function is
involved.
So if we are wanting to make a change, we would need to remove
portfolios that are currently queued from the queue or alert the person
deleting the portfolio that they can't right now because it is still
being copied.
https://reviews.mahara.org/c/mahara/+/11673 points to the patch in which
we removed the line to delete a collection.
** No longer affects: mahara/22.04
** Changed in: mahara/22.10
Milestone: 22.10.0 => 23.04.0
--
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/1969693
Title:
Error appears when deleting Institution collections that have been
auto-copied to members accounts
Status in Mahara:
Confirmed
Status in Mahara 22.10 series:
Confirmed
Bug description:
This happens in both MySQL and Postgres
To replicate:
1. Create an institution template collection (set to 'Current auto-copied template') with portfolio completion.
2. Create a new account and run the cron so that the portfolio is created in the new member's account.
3. As admin, try to delete the institution template collection.
Result
- SQL error messages on screen. There is a foreign key constraint with collection_template.originaltemplate = collection.id, so it won't allow you to delete from collection table until collection_template table entries are cleared.
Expected:
- Perhaps there should be a warning to institution admins that the collection has been auto-copied before deleting it.
- I think we need to delete from the collection_template table where
originaltemplate = $this->id, rather than where collection = $this->id
(htdocs/lib/collection.php:324). Then we'll be able to delete from
collection table.
Kristina mentioned that a Behat test for this would be good, since we
don't regularly come across this scenario.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1969693/+subscriptions
References