Index: openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl 2 Sep 2003 10:06:25 -0000 1.3 +++ openacs-4/packages/acs-service-contract/tcl/msg-type-procs.tcl 27 Oct 2014 16:39:44 -0000 1.4 @@ -20,25 +20,29 @@ } ad_proc -public acs_sc::msg_type::delete { - {-msg_type_id} - {-name} + {-msg_type_id ""} + {-name ""} } { Delete a message type. Supply either ID or name. @param msg_type_id The ID of the msg_type to delete. @param name Name of the service contract to delete } { - if { ![exists_and_not_null msg_type_id] && ![exists_and_not_null name] } { + if { $msg_type_id eq "" && $name eq "" } { error "You must supply either name or msg_type_id" } # LARS: # It seems like delete by ID doesn't work, because our PG bind thing turns all integers into strings # by wrapping them in single quotes, causing PG to invoke the function for deleting by name - if { ![exists_and_not_null name] } { + if { $name eq "") } { # get msg_type name - db_1row select_name {} + db_1row select_name { + select msg_type_name as name + from acs_sc_msg_types + where msg_type_id = :msg_type_id + } } db_exec_plsql delete_by_name {}