← Back to team overview

mahara-contributors team mailing list archive

[Bug 1969693] Re: Error appears when deleting Institution collections that have been auto-copied to members accounts

 

In the original description, it says this applies to Postgres and MySQL,
but I think this is not about which database type used: we encountered
the same in MariaDB.

We'd be in favour of having a proper message telling the authorized user
they cannot delete a portfolio while automated copies are pending (or
other relations have been established between template and copies).

Are we correct in establishing this is a low to medium impact bug?

-- 
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