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.368.2.147 -r1.368.2.148 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 14 Dec 2023 09:57:31 -0000 1.368.2.147 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 20 Dec 2023 11:04:28 -0000 1.368.2.148 @@ -2696,6 +2696,13 @@ array set containers [list] set cc [::${:package_id} context] + # + # Fetching the form data may also affect this object's + # variables. Backup the old page object to revert these changes in + # case of validation error. + # + :copy old_page + if {![info exists field_names]} { # # Field names might come directly from the POST request payload @@ -2943,6 +2950,13 @@ foreach f $form_fields { $f reset_on_validation_error } + # + # Revert changes performed by this method on the page object, as + # these may come from data failing to validate. + # + foreach var [old_page info vars] { + set :$var [old_page set $var] + } } #:log "=== get_form_data has validation_errors $validation_errors, instance_attributes: ${:instance_attributes}"