Reviewed:  https://reviews.mahara.org/3422
Committed: 
http://gitorious.org/mahara/mahara/commit/64141d43025c70151fd3b462468eeb6eddd8da3c
Submitter: Robert Lyon (robe...@catalyst.net.nz)
Branch:    master

commit 64141d43025c70151fd3b462468eeb6eddd8da3c
Author: Son Nguyen <son.ngu...@catalyst.net.nz>
Date:   Tue Jun 10 11:53:06 2014 +1200

Delete leftover data not associated to any institution (Bug 1314440)

Another patch for bug 1314440 makes it so that when you delete an
institution, this data gets deleted. This patch cleans up the data
for institutions that were deleted before that patch was merged.

Change-Id: I167001f444a3fd204b12610ca10274d6218d9f96
Signed-off-by: Son Nguyen <son.ngu...@catalyst.net.nz>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1314440

Title:
  Deleting an institution which has user's registrations causes error

Status in Mahara ePortfolio:
  Fix Committed
Status in Mahara 1.10 series:
  Fix Committed

Bug description:
  Version: master(1.10)
  Platform: all

  When deleting an institution which contains some registrations, I got
  the following error:

    [WAR] a6 (lib/errors.php:739) Failed to get a recordset: postgres7 error: 
[-1: ERROR:  update or delete on table "institution" violates foreign key 
constraint "usrregi_ins_fk" on table "usr_registration"
  DETAIL:  Key (name)=(instone) is still referenced from table 
"usr_registration".] in adodb_throw(DELETE FROM "institution"  WHERE "name" = ? 
, Array)
  Command was: DELETE FROM "institution"  WHERE "name" = ?  and values was 
(instone)
  Call stack (most recent first):
  log_message("Failed to get a recordset: postgres7 error: [-1: E...", 8, true, 
true) at /home/sonn/code/mahara/master/htdocs/lib/errors.php:95
  log_warn("Failed to get a recordset: postgres7 error: [-1: E...") at 
/home/sonn/code/mahara/master/htdocs/lib/errors.php:739
  SQLException->__construct("Failed to get a recordset: postgres7 error: [-1: 
E...") at /home/sonn/code/mahara/master/htdocs/lib/dml.php:925
  delete_records("institution", "name", "instone") at 
/home/sonn/code/mahara/master/htdocs/admin/users/institutions.php:162
  delete_submit(object(Pieform), array(size 4)) at Unknown:0
  call_user_func_array("delete_submit", array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:527
  Pieform->__construct(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:162
  Pieform::process(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:71
  pieform(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/admin/users/institutions.php:185
  [WAR] a6 (lib/dml.php:925) Failed to get a recordset: postgres7 error: [-1: 
ERROR:  update or delete on table "institution" violates foreign key constraint 
"usrregi_ins_fk" on table "usr_registration"
  DETAIL:  Key (name)=(instone) is still referenced from table 
"usr_registration".] in adodb_throw(DELETE FROM "institution"  WHERE "name" = ? 
, Array)
  Command was: DELETE FROM "institution"  WHERE "name" = ?  and values was 
(instone)
  Call stack (most recent first):
  delete_records("institution", "name", "instone") at 
/home/sonn/code/mahara/master/htdocs/admin/users/institutions.php:162
  delete_submit(object(Pieform), array(size 4)) at Unknown:0
  call_user_func_array("delete_submit", array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:527
  Pieform->__construct(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:162
  Pieform::process(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/lib/pieforms/pieform.php:71
  pieform(array(size 2)) at 
/home/sonn/code/mahara/master/htdocs/admin/users/institutions.php:185

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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to