Index: openacs-4/packages/acs-subsite/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs.tcl,v diff -u -r1.40 -r1.40.2.1 --- openacs-4/packages/acs-subsite/tcl/package-procs.tcl 25 Jul 2018 01:28:26 -0000 1.40 +++ openacs-4/packages/acs-subsite/tcl/package-procs.tcl 1 Mar 2019 15:29:31 -0000 1.40.2.1 @@ -206,7 +206,7 @@ # return to null unless this attribute is required # (min_n_values > 0) - return [ad_decode $min_n_values 0 "NULL" ""] + return [expr {$min_n_values > 0 ? "" : "NULL"}] } @@ -502,9 +502,13 @@ for { set i 0 } { $i < [llength $primary_keys] - 1 } { incr i } { lappend pk_formatted "[lindex $primary_keys $i] = [lindex $primary_keys $i+1]" } + if {[llength $pk_formatted] > 0} { + set where_clause [join [string tolower $pk_formatted] "\n AND "] + set where_clause " WHERE $where_clause" + } return "SELECT [string tolower [join $columns ",\n "]] FROM [string tolower [join $tables ", "]] -[ad_decode [llength $pk_formatted] "0" "" " WHERE [join [string tolower $pk_formatted] "\n AND "]"]" +$where_clause" } Index: openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl,v diff -u -r1.20 -r1.20.2.1 --- openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl 17 Sep 2018 13:47:05 -0000 1.20 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl 1 Mar 2019 15:31:13 -0000 1.20.2.1 @@ -550,14 +550,14 @@ lappend option_list [list " (no value) " ""] } template::element create $form_id "$variable_prefix$attribute_name" \ - -datatype "text" [ad_decode $required_p "f" "-optional" ""] \ + -datatype "text" [expr {$required_p eq "f" ? "-optional" : ""}] \ -widget select \ -options $option_list \ -label "$pretty_name" \ -value $default } else { template::element create $form_id "$variable_prefix$attribute_name" \ - -datatype $datatype [ad_decode $required_p "f" "-optional" ""] \ + -datatype $datatype [expr {$required_p eq "f" ? "-optional" : ""}] \ -widget text \ -label $pretty_name \ -value $default