Index: openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 14 Oct 2004 11:44:51 -0000 1.1 +++ openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 15 Nov 2004 17:17:15 -0000 1.2 @@ -7,7 +7,6 @@ namespace eval as::item_type_sa {} ad_proc -public as::item_type_sa::new { - {-name:required} {-title ""} {-increasing_p ""} {-allow_negative_p ""} @@ -21,8 +20,15 @@ set folder_id [db_string get_folder_id "select folder_id from cr_folders where package_id=:package_id"] # Insert as_item_type_sa in the CR (and as_item_type_sa table) getting the revision_id (as_item_type_id) - set item_item_type_sa_id [content::item::new -parent_id $folder_id -content_type {as_item_type_sa} -name $name -title $title ] - set as_item_type_sa_id [content::revision::new -item_id $item_item_type_sa_id -content_type {as_item_type_sa} -title $title -attributes [list [list increasing_p $increasing_p] [list allow_negative_p $allow_negative_p] ] ] + db_transaction { + set item_item_type_sa_id [content::item::new -parent_id $folder_id -content_type {as_item_type_sa} -name [ad_generate_random_string] -title $title ] + set as_item_type_sa_id [content::revision::new \ + -item_id $item_item_type_sa_id \ + -content_type {as_item_type_sa} \ + -title $title \ + -attributes [list [list increasing_p $increasing_p] \ + [list allow_negative_p $allow_negative_p] ] ] + } return $as_item_type_sa_id }