Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 3 Nov 2003 14:07:42 -0000 1.14 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 6 Nov 2003 15:33:20 -0000 1.15 @@ -92,27 +92,25 @@ @param additional_properites a list of additional properties / columns to insert format: {property value ... property value} {property:noquote value} will directly use what is value } { - if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } - if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } + if { ![info exists creation_user_id] } { set creation_user_id [ad_conn user_id] } + if { ![info exists creation_ip] } { set creation_ip [ad_conn peeraddr] } - if ![info exists content_type] { + if { ![info exists content_type] } { set content_type [bcms::item::get_content_type -item_id $item_id] } set table_name [bcms::get_table_name -object_type $content_type] # get the file properties set upload_filename [template::util::file::get_property filename $upload_file] set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - if {![info exists mime_type]} { + if { ![exists_and_not_null mime_type] } { set mime_type [template::util::file::get_property mime_type $upload_file] } - # check the mime type if it does not exists insert it - if ![db_0or1row check_mime "SQL"] { - set file_extension [string range [file extension $upload_filename] 1 end] - db_dml new_mime_type "SQL" + if { ![exists_and_not_null mime_type] } { + set mime_type [cr_filename_to_mime_type -create $upload_filename] } - if {[exists_and_not_null additional_properties]} { + if { [exists_and_not_null additional_properties] } { set addtnl_properties ", [bcms::parse_properties -properties $additional_properties -return_format insert_columns]" set addtnl_values ", [bcms::parse_properties -properties $additional_properties -return_format insert_values]" } else { @@ -128,8 +126,8 @@ # since we are using the file system we will set content to the filename in the fs set content $tmp_filename - db_dml insert_revision "SQL" - db_dml update_file_size "SQL" + db_dml insert_revision {} + db_dml update_file_size {} } return $revision_id Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql 27 Oct 2003 10:09:10 -0000 1.5 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql 6 Nov 2003 15:33:20 -0000 1.6 @@ -26,15 +26,6 @@ - - - insert into cr_mime_types - (mime_type, file_extension) - values - (:mime_type, :file_extension) - - - update cr_revisions