Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -N -r1.485.2.31 -r1.485.2.32 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 3 Nov 2016 10:50:56 -0000 1.485.2.31 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 Nov 2016 13:45:54 -0000 1.485.2.32 @@ -2777,11 +2777,29 @@ # foreach name_and_spec [my get_form_constraints] { regexp {^([^:]+):(.*)$} $name_and_spec _ spec_name short_spec + if {[string match $spec_name $name]} { set f [my create_form_fields_from_form_constraints [list $name:$short_spec]] set $key $f return $f } + + # + # Maybe, this was a repeat field, and we have to create the nth + # component dynamically. + # + if {[regexp {^(.*)[.](\d+)$} $name . root number]} { + ns_log notice "dynamic repeat field <$root> number $number [info exists ::_form_field_names($root)]" + if {[info exists ::_form_field_names($root)]} { + set repeatField [set ::_form_field_names($root)] + # + # Maybe we have to check the order (when e.g. text.5 is passed in before text.3) + # + set f [$repeatField require_component $number] + ns_log notice "dynamic repeat field required $f" + return $f + } + } } if {$name ni {langmarks fontname fontsize formatblock}} { set names [list]