Index: openacs-4/packages/acs-object-management/tcl/object-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-object-management/tcl/object-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-object-management/tcl/object-procs.tcl 10 Nov 2010 18:27:20 -0000 1.7 +++ openacs-4/packages/acs-object-management/tcl/object-procs.tcl 28 Feb 2011 01:26:31 -0000 1.8 @@ -11,15 +11,6 @@ namespace eval object {} -ad_proc -private object::quote_attribute_values { - -array:required -} { - upvar $array attributes - foreach attribute [array names attributes] { - set attributes($attribute) "'[DoubleApos $attributes($attribute)]'" - } -} - ad_proc -private object::split_attributes { -object_type:required -attributes_array:required @@ -117,16 +108,10 @@ foreach name [array names our_attributes] { lappend name_list $name set __$name $our_attributes($name) - if {![string match "to_timestamp(*" [set __$name]]} { - lappend value_list ":__${name}" - } else { - lappend value_list "[set __${name}]" - } + lappend value_list ":__${name}" } - set SQL [db_map insert_object] + db_dml insert_object {} - db_dml insert_object_q $SQL - } else { # error for now as we don't handle generics etc return -code error "Generic attributes are not supported." @@ -181,8 +166,6 @@ set attributes_array(object_type) $object_type -# object::quote_attribute_values -array attributes_array - db_transaction { set object_id [object::new_inner \ -object_type $object_type \ @@ -219,7 +202,6 @@ set attributes(creation_user) "[ad_conn user_id]" set attributes(creation_ip) "[ad_conn peeraddr]" set attributes(object_type) "$object_type" -# object::quote_attribute_values -array attributes db_transaction { object::new_inner \ -object_type $object_type \ @@ -330,17 +312,11 @@ foreach name [array names our_attributes] { set __$name $our_attributes($name) - if {![string match "to_timestamp(*" [set __$name]]} { - lappend name_value_list "$name = :__${name}" - } else { - lappend name_value_list "$name = [set __${name}]" - } - + lappend name_value_list "$name = :__${name}" } if { [info exists name_value_list] } { - set SQL [db_map update_object] - db_dml update_object_q $SQL + db_dml update_object {} } } else { @@ -368,16 +344,14 @@ array set attributes_array $attributes if { [ad_conn isconnected] } { - if { ![exists_and_not_null attributes_array(modifying_user)] } { - set attributes_array(modifying_user) [ad_conn user_id] - } - if { ![exists_and_not_null attributes_array(modifying_ip)] } { - set attributes_array(modifying_ip) [ad_conn peeraddr] - } + if { ![exists_and_not_null attributes_array(modifying_user)] } { + set attributes_array(modifying_user) [ad_conn user_id] + } + if { ![exists_and_not_null attributes_array(modifying_ip)] } { + set attributes_array(modifying_ip) [ad_conn peeraddr] + } } -# object::quote_attribute_values -array attributes_array - set object_type [object::get_object_type -object_id $object_id] db_transaction {