Can't delete institution when users have accepted its privacy statement

Bug #1748079 reported by Cecilia Vela Gurovic on 2018-02-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
High
Cecilia Vela Gurovic

Bug Description

to replicate:

Set privacy switch to true in 'Site opstions' -> "Institutions'
Create an institution and add a privacy to it
Add a user to the institution, login as the user and accept the privacy statement
Remove the user from the institution
Try to delete the institution

An error is displayed and the institution is not deleted:

[WAR] 92 (lib/errors.php:859) Failed to get a recordset: postgres8 error: [-1: ERROR: update or delete on table "site_content_version" violates foreign key constraint "usragre_sit_fk" on table "usr_agreement"
DETAIL: Key (id)=(5) is still referenced from table "usr_agreement".] in adodb_throw(DELETE FROM "site_content_version" WHERE "institution" = ? , Array)Command was: DELETE FROM "site_content_version" WHERE "institution" = ? and values was (0:institutioni)

This would also need to be checked for the Terms and Conditions as they rely on pretty much the same code.

summary: - delete institution when users have accepted its privacy agreement
+ Can't delete institution when users have accepted its privacy statement
Robert Lyon (robertl-9) on 2018-03-06
Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Changed in mahara:
status: Confirmed → In Progress

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

commit e98fd36d56fecb25d23bc1c0fa80cc3464c1866c
Author: Cecilia Vela Gurovic <email address hidden>
Date: Tue Mar 6 13:57:47 2018 +1300

Bug 1748079: deleting usr agreement when deleting intitution

behatnotneeded

Change-Id: I421ba98f8d9586a6049bd47cef6de8a40d598904

Robert Lyon (robertl-9) on 2018-03-06
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2018-04-05
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers