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 -r1.542.2.151 -r1.542.2.152 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 21 Mar 2022 14:58:25 -0000 1.542.2.151 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 8 Apr 2022 09:40:09 -0000 1.542.2.152 @@ -3995,10 +3995,41 @@ # use default widget spec return $default_spec } - + + PageInstance instproc adp_parse_tags {HTML} { + # + # This method is similar to + # + # template::adp_compile -string $HTML + # + # but it just performs tag substion (and not ADP variable + # substitution, since this is done differently concerning instance + # attributes, etc) on the provided HTML chunk. + # + #ns_log notice "adp_parse_tags BEGIN: $HTML" + set old_parse_list [expr {[info exists ::template::parse_list] ? $::template::parse_list : ""}] + set ::template::parse_list "" + # + # The following exception handler is just for safety to achieve a + # high-level of backward compatibility. In case + # "adp_compile_chunk" and or the evaluation of the resulting code + # fails, fall back to the original behavior without ADP tag + # substitution. + # + try { + template::adp_compile_chunk $HTML + set HTML [eval [join $::template::parse_list \n]] + } on error {errorMsg} { + ad_log warning "adp_parse_tags failed on parsing:\n$HTML" + } + set ::template::parse_list $old_parse_list + #ns_log notice "adp_parse_tags END: $HTML" + return $HTML + } + PageInstance instproc get_form {} { # get the (HTML) form of the ::xowiki::PageTemplates/::xowiki::Form - return [:get_html_from_content [:get_from_template form]] + return [:adp_parse_tags [:get_html_from_content [:get_from_template form]]] } PageInstance instproc get_template_object {} { @@ -5116,6 +5147,7 @@ #if {[string match _* $att]} continue lappend field_names $att } + #ns_log notice "field_names_from_form: [:serialize]" dom parse -simple -html $form doc $doc documentElement root set fields [$root selectNodes "//*\[@name != ''\]"]