Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.87.2.5 -r1.87.2.6 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 5 Jul 2019 10:00:54 -0000 1.87.2.5 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 27 Aug 2019 09:56:17 -0000 1.87.2.6 @@ -806,12 +806,13 @@ } } - # Antonio Pisano: export property will eventually end up into - # template::form::render, where export_vars will take care of - # creating the required hidden form fields according to - # specification. + # Use export_vars to serialize variables from -export flag as + # hidden form fields. We need to do it now rather than later in + # the rendering, as only now the uplevel variables come from is + # well known. if { [info exists export] } { - template::form::set_properties $form_name export $export + template::form::set_properties $form_name exported_vars \ + [uplevel [list export_vars -form $export]] } # We need to track these for submission time and for error checking Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.59 -r1.59.2.1 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 28 Dec 2018 11:24:10 -0000 1.59 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 27 Aug 2019 09:56:17 -0000 1.59.2.1 @@ -633,12 +633,11 @@ append output "$fieldset_legend" } - # Export variables specified by the export property as hidden - # formfields. (used e.g. by ad_form when specifying the -export - # flag) - if { [info exists form_properties(export)] } { + # Include exported variables created by ad_form when specifying + # the -export flag + if { [info exists form_properties(exported_vars)] } { append output {} - append output [uplevel #$level [subst {export_vars -form {$form_properties(export)}}]] + append output $form_properties(exported_vars) append output {} }