** Description changed: 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 + - 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. + - 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.
** Description changed: 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. -- 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: New 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 _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

