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 -N -r1.299 -r1.300 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 28 Sep 2011 07:48:44 -0000 1.299 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 28 Sep 2011 08:36:11 -0000 1.300 @@ -1878,24 +1878,27 @@ incr validation_errors } } - my log validation_errors=$validation_errors if {$validation_errors == 0} { # # Postprocess based on form fields based on form-fields methods. # foreach f $form_fields { - $f convert_to_internal - } else { - # Reset the value of the form-field to avoid confusion, since - # the file-name was provided, but the file was not - # uploaded. Maybe a new method "reset-to-default" would be a - # good idea. - foreach f $form_fields { - if {[$f type] eq "file"} { - $f set value "" - } - } + $f convert_to_internal } + } else { + my log validation_errors=$validation_errors + + # There were validation erros. Reset the value for form-fields + # of type "file" to avoid confusions, since a file-name was + # provided, but the file was not uploaded due to the validation + # error. If we would not reset the value, the provided name + # would cause an interpretation of an uploaded empty file. Maybe + # a new method "reset-to-default" would be a good idea. + foreach f $form_fields { + if {[$f type] eq "file"} { + $f set value "" + } + } } my instance_attributes [array get __ia]