Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.180.2.81 -r1.180.2.82 --- openacs-4/packages/xowiki/xowiki.info 18 Jan 2022 12:51:45 -0000 1.180.2.81 +++ openacs-4/packages/xowiki/xowiki.info 26 Jan 2022 08:59:18 -0000 1.180.2.82 @@ -10,7 +10,7 @@ t xowiki - + Gustaf Neumann A xotcl-based enterprise wiki system with multiple object types 2021-09-15 @@ -55,7 +55,7 @@ BSD-Style 2 - + Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v diff -u -r1.71.2.24 -r1.71.2.25 --- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 15 Jan 2022 16:16:04 -0000 1.71.2.24 +++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 26 Jan 2022 08:59:18 -0000 1.71.2.25 @@ -316,4 +316,7 @@ to Archive When the item is archived, it is not shown to users anymore. + Invalid option value + Invalid selected page + Invalid Boolean value 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 -r1.284.2.190 -r1.284.2.191 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 18 Jan 2022 06:55:23 -0000 1.284.2.190 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 26 Jan 2022 08:59:18 -0000 1.284.2.191 @@ -4181,12 +4181,14 @@ ########################################################### # abstract superclass for "select" and "radio" - Class create ShuffleField -superclass FormField -parameter { - {options ""} - {render_hints ""} - {show_max ""} - {shuffle_kind:wordchar none} - } -ad_doc { + Class create ShuffleField -superclass FormField \ + -extend_slot_default validator options \ + -parameter { + {options ""} + {render_hints ""} + {show_max ""} + {shuffle_kind:wordchar none} + } -ad_doc { An abstract class for shuffling options and answers. The options can be used a content of checkboxes, radioboxes and the like. This @@ -4196,6 +4198,25 @@ } ShuffleField set abstract 1 + ShuffleField instproc check=options {value} { + set result 1 + if {$value ne "" && [info exists :options]} { + set allowed_values [lmap option ${:options} {lindex $option 1}] + if {!${:multiple}} { + set value [list $value] + } + foreach v $value { + if {$v ni $allowed_values} { + set result 0 + break + } + } + ns_log notice "OPTIONS CHECK <$value> in <$allowed_values> -> $result" \ + "([:info class])" + } + return $result + } + ShuffleField instproc randomized_indices {length} { # # Produce a list of random indices. @@ -5435,6 +5456,20 @@ next } + abstract_page instproc check=options {value} { + # + # This is a very basic check, which disallows in essence space and + # some funny characters. + # + if {${:multiple}} { + set result [nsf::is graph,0..n $value] + } else { + set result [nsf::is graph $value] + } + #ns_log notice "OPTIONS CHECK abstract_page '$value' -> $result // '${:multiple}'" + return $result + } + abstract_page instproc fetch_entry_label {entry_label item_id} { # The following is a temporary solution, only working with cr-item attributes # We should support as well user level instance attributes. @@ -6244,6 +6279,10 @@ Class create boolean_checkbox -superclass checkbox -parameter { {default t} } + boolean_checkbox instproc check=options {value} { + return [expr {$value in {t f ""}}] + } + boolean_checkbox instproc value_if_nothing_is_returned_from_form {default} { if {[info exists :disabled]} { return $default