Index: openacs-4/packages/edit-this-page/www/etp-trash.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/etp-trash.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/edit-this-page/www/etp-trash.tcl 24 Sep 2001 17:24:13 -0000 1.1 +++ openacs-4/packages/edit-this-page/www/etp-trash.tcl 9 Nov 2001 03:00:50 -0000 1.2 @@ -16,12 +16,21 @@ set package_id [ad_conn package_id] -if {[db_0or1row get_node_id ""]} { - site_map_unmount_application -delete_p "t" $node_id -} +db_transaction { -db_dml trash_item "" + if {[db_0or1row get_node_id ""]} { + site_map_unmount_application -delete_p "t" $node_id + } + # If an item with the same name is already in the trash, + # rename this item to "Copy of foo". + while {[db_string matching_name ""] > 0} { + db_dml update_name "" + } + + db_dml trash_item "" + +} ad_returnredirect "etp" ad_script_abort