Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 27 Feb 2004 20:12:13 -0000 1.23 +++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 1 Mar 2004 11:06:52 -0000 1.24 @@ -702,6 +702,19 @@ -status "live" # FIXME: The way we do this update is not very pretty: Delete all relations and re-add the new ones + # We need to also delete from acs_objects table, otherwise we get a context_id integrity violation + # when trying to delete the item + set old_relations [db_list select_old_relations { + select rel_id + from cr_item_rels + where item_id = :item_id + }] + foreach rel_id $old_relations { + db_exec_plsql delete_relation { + select acs_object__delete(:rel_id) + } + } + db_dml delete_all_relations { delete from cr_item_rels where item_id = :item_id Index: openacs-4/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/object-edit.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/simulation/www/citybuild/object-edit.tcl 27 Feb 2004 20:12:13 -0000 1.23 +++ openacs-4/packages/simulation/www/citybuild/object-edit.tcl 1 Mar 2004 11:06:52 -0000 1.24 @@ -702,6 +702,19 @@ -status "live" # FIXME: The way we do this update is not very pretty: Delete all relations and re-add the new ones + # We need to also delete from acs_objects table, otherwise we get a context_id integrity violation + # when trying to delete the item + set old_relations [db_list select_old_relations { + select rel_id + from cr_item_rels + where item_id = :item_id + }] + foreach rel_id $old_relations { + db_exec_plsql delete_relation { + select acs_object__delete(:rel_id) + } + } + db_dml delete_all_relations { delete from cr_item_rels where item_id = :item_id