Index: openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl,v diff -u -N -r1.5 -r1.5.10.1 --- openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl 10 Jan 2007 21:22:05 -0000 1.5 +++ openacs-4/packages/acs-service-contract/tcl/contract-procs.tcl 2 Oct 2013 22:41:59 -0000 1.5.10.1 @@ -134,24 +134,24 @@ } ad_proc -public acs_sc::contract::delete { - {-contract_id} - {-name} + {-contract_id ""} + {-name ""} {-no_cascade:boolean} } { Delete a service contract definition. Supply either contract_id or name. @param contract_id The ID of the service contract to delete @param name Name of the service contract to delete } { - if { ![exists_and_not_null contract_id] && ![exists_and_not_null name] } { + if { $contract_id eq "" && $name eq "" } { error "You must supply either name or contract_id" } db_transaction { # Need both name and ID below - if { ![exists_and_not_null name] } { + if { (![info exists name] || $name eq "") } { set name [db_string get_name_by_id {}] - } elseif { ![exists_and_not_null contract_id] } { + } elseif { (![info exists contract_id] || $contract_id eq "") } { set contract_id [db_string get_id_by_name {}] } @@ -246,24 +246,25 @@ } ad_proc -public acs_sc::contract::operation::delete { - {-operation_id} - {-contract_name} - {-operation_name} + {-operation_id ""} + {-contract_name ""} + {-operation_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 operation_id] && ( ![exists_and_not_null contract_name] || ![exists_and_not_null operation_name] ) } { + if { $operation_id eq "" && ( $contract_name eq "" || $operation_name eq "") + } { error "You must supply either contract_name and operation_name, or operation_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 contract_name] || ![exists_and_not_null operation_name] } { + if { $contract_name eq "" || $operation_name eq "" } { # get contract_name and operation_name db_1row select_names {} }