Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -N -r1.284.2.78 -r1.284.2.79 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 6 Feb 2020 13:43:08 -0000 1.284.2.78 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 11 Feb 2020 12:47:59 -0000 1.284.2.79 @@ -3405,7 +3405,7 @@ enumeration instproc initialize {} { if {[info exists :category_tree]} { - :config_from_category_tree [:category_tree] + :config_from_category_tree ${:category_tree} } if {[info exists :answer]} { set count 1 @@ -3599,7 +3599,7 @@ set package_id [${:object} package_id] set tree_ids [::xowiki::Category get_mapped_trees \ - -object_id $package_id -locale [:locale] \ + -object_id $package_id -locale ${:locale} \ -names $tree_name -output tree_id] # In case there are multiple trees with the same name, @@ -3624,7 +3624,18 @@ } lappend options [list $category_name $category_id] } - :options $options + set :options $options + if {[info exists :default] && ${:default} ne ""} { + # + # When a default is provided, and the default is a valid + # name. Note that the "symbolic" default has to be provided + # exactly like the label, and it might not be unique. + # + set optdict [concat {*}$options] + if {[dict exists $optdict ${:default}]} { + set :default [dict get $optdict ${:default}] + } + } set :is_category_field 1 # :msg label_could_be=$tree_name,existing=${:label} # if {![info exists :label]} {