Index: openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl 20 Apr 2001 20:51:14 -0000 1.1 +++ openacs-4/packages/ecommerce/www/admin/customer-service/issue-edit-2.tcl 29 Jan 2002 00:11:46 -0000 1.2 @@ -17,16 +17,19 @@ ad_require_permission [ad_conn package_id] admin -db_transaction { +# Another hack to make this crap code work. The foreach below loops only over +# the list of issue type already assigned to the issue. Hence, to make this work +# the new list is concatenated to the old list. +set issue_type_list [concat $issue_type_list $issue_type] -db_dml delete_from_issue_type_map "delete from ec_cs_issue_type_map where issue_id=:issue_id" - -foreach issue_type $issue_type_list { - db_dml insert_into_type_map "insert into ec_cs_issue_type_map (issue_id, issue_type) values (:issue_id,:issue_type)" +db_transaction { + db_dml delete_from_issue_type_map "delete from ec_cs_issue_type_map where issue_id=:issue_id" + foreach issue_type $issue_type_list { + if {$issue_type != "" } { + db_dml insert_into_type_map "insert into ec_cs_issue_type_map (issue_id, issue_type) values (:issue_id,:issue_type)" + } + } } - -} - db_release_unused_handles ad_returnredirect "issue?[export_url_vars issue_id]" \ No newline at end of file