← Back to team overview

mahara-contributors team mailing list archive

[Bug 1314440] [NEW] Deleting an institution which has user's registrations causes error

 

Public bug reported:

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

** Affects: mahara
     Importance: High
     Assignee: Son Nguyen (ngson2000)
         Status: In Progress

** Changed in: mahara
     Assignee: (unassigned) => Son Nguyen (ngson2000)

** Changed in: mahara
       Status: New => In Progress

-- 
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:
  In Progress

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


Follow ups

References