Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.301 -r1.302 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 28 Sep 2011 08:59:20 -0000 1.301 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 24 Dec 2011 09:58:36 -0000 1.302 @@ -619,7 +619,7 @@ #my log anon_instances=$anon_instances set field_names [my field_names -form $form] - #my log field_names=$field_names + #my msg field_names=$field_names set form_fields [my create_form_fields $field_names] if {$form eq ""} { @@ -1752,9 +1752,12 @@ #my log "form-params=[$cc array get form_parameter]" } #my msg "fields $field_names // $form_fields" + #foreach f $form_fields { my msg "... $f [$f name]" } - # we have a form and get all form variables - + # + # We have a form and get all form input from the fields of the + # from into form field objects. + # foreach att $field_names { #my msg "getting att=$att" set processed($att) 1 @@ -1775,7 +1778,7 @@ # get rid of strange utf-8 characters hex C2AD (firefox bug?) # ns_log notice "FORM_DATA var=$varname, value='$value' s=$s" if {$varname eq "text"} {regsub -all "­" $value "" value} - # ns_log notice "FORM_DATA var=$varname, value='$value' s=$s" + #ns_log notice "FORM_DATA var=$varname, value='$value'" if {![string match *.* $att]} {my set $varname $value} } default { @@ -1872,12 +1875,14 @@ # Run validators # set validation_error [$f validate [self]] - #my msg "validation of [$f name] with value '[$f value]' returns '$validation_error'" if {$validation_error ne ""} { + #my msg "validation of $f [$f name] with value '[$f value]' returns '$validation_error'" $f error_msg $validation_error incr validation_errors } } + #my msg "validation returns $validation_errors errors" + if {$validation_errors == 0} { # # Postprocess based on form fields based on form-fields methods. @@ -1971,7 +1976,7 @@ FormPage instproc field_names {{-form ""}} { my instvar package_id foreach {form_vars needed_attributes} [my field_names_from_form -form $form] break - #my log "form=$form, form_vars=$form_vars needed_attributes=$needed_attributes" + #my msg "form=$form, form_vars=$form_vars needed_attributes=$needed_attributes" my array unset __field_in_form my array unset __field_needed if {$form_vars} {foreach v $needed_attributes {my set __field_in_form($v) 1}} @@ -1981,9 +1986,9 @@ # Remove the fields already included in auto_fields form the needed_attributes. # The final list field_names determines the order of the fields in the form. # - set auto_fields [list _name _page_order _creator _title _text _description _nls_language] + set auto_fields [list _name _page_order _title _creator _assignee _text _description _nls_language] set reduced_attributes $needed_attributes - + foreach f $auto_fields { set p [lsearch $reduced_attributes $f] if {$p > -1} { @@ -1993,15 +1998,15 @@ set reduced_attributes [lreplace $reduced_attributes $p $p] } } - #my msg reduced_attributes=$reduced_attributes + #my msg reduced_attributes(after)=$reduced_attributes #my msg fields_from_form=[my array names __field_in_form] set field_names [list _name] if {[$package_id show_page_order]} { lappend field_names _page_order } lappend field_names _title _creator _assignee foreach fn $reduced_attributes { lappend field_names $fn } foreach fn [list _text _description _nls_language] { lappend field_names $fn } - #my msg field_names=$field_names + #my msg final-field_names=$field_names return $field_names }