Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -N -r1.79.2.56 -r1.79.2.57 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 20 Feb 2022 13:09:10 -0000 1.79.2.56 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 2 Mar 2022 13:18:42 -0000 1.79.2.57 @@ -1919,6 +1919,12 @@ set name [get_name_attribute $n $xpath//input] if {$name eq ""} continue + # Disabled attributes are not sent together with the form + # on submit, so we do not fetch them. + if {[$n hasAttribute disabled]} { + continue + } + # Do not consider unchecked radio buttons as values if {[$n getAttribute type ""] eq "radio" && ![$n hasAttribute checked]} { @@ -1936,13 +1942,27 @@ foreach n [$node selectNodes $xpath//textarea] { set name [get_name_attribute $n $xpath//textarea] if {$name eq ""} continue + + # Disabled attributes are not sent together with the form + # on submit, so we do not fetch them. + if {[$n hasAttribute disabled]} { + continue + } + #ns_log notice "aa_xpath::get_form_values from $className textarea node $n name $name:" set value [$n text] lappend values $name $value } foreach n [$node selectNodes $xpath//select/option\[@selected='selected'\]] { set name [get_name_attribute [$n parentNode] $xpath//option/..] if {$name eq ""} continue + + # Disabled attributes are not sent together with the form + # on submit, so we do not fetch them. + if {[$n hasAttribute disabled]} { + continue + } + set value [$n getAttribute value] lappend values $name $value } Index: openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/Attic/xowiki-test-procs.tcl,v diff -u -N -r1.1.2.69 -r1.1.2.70 --- openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 2 Mar 2022 10:46:48 -0000 1.1.2.69 +++ openacs-4/packages/xowiki/tcl/test/xowiki-test-procs.tcl 2 Mar 2022 13:18:42 -0000 1.1.2.70 @@ -671,7 +671,7 @@ form_constraints { _page_order:omit _title:omit _nls_language:omit _description:omit date:date - {date2:date,format=DD_MONTH_YYYY_HH24_MI,default=2011-01-01 20:55,disabled,error_msg=__xowiki_test_errmsg} + {date2:date,format=DD_MONTH_YYYY_HH24_MI,default=2011-01-01 20:55,disabled} } }] aa_log "Form $form_name created" @@ -703,8 +703,6 @@ acs::test::reply_has_status_code $d 200 set response [dict get $d body] - aa_true "Page does not contain a form error for date2 field" \ - {[string first __xowiki_test_errmsg $response] == -1} acs::test::dom_html root $response { set f_id [::xowiki::test::get_object_name $root] set CSSclass [::xowiki::test::get_form_CSSclass $root] @@ -717,6 +715,21 @@ aa_true "input1 (1st element of date)" {$input1 ne ""} aa_true "input2 (2nd element of date)" {$input2 ne ""} aa_true "input3 (3rd element of date)" {[$input3 getAttribute value] eq ""} + + set input4 [$root selectNodes \ + "//select\[@id='$id_part.date2.DD'\]/option\[@selected\]"] + set input5 [$root selectNodes \ + "//select\[@id='$id_part.date2.month'\]/option\[@selected\]"] + set input6 [$root getElementById $id_part.date2.YYYY] + set input7 [$root selectNodes \ + "//select\[@id='$id_part.date2.HH24'\]/option\[@selected\]"] + set input8 [$root selectNodes \ + "//select\[@id='$id_part.date2.MI'\]/option\[@selected\]"] + aa_true "input4 (1st element of date2)" {[$input4 getAttribute value] eq "1"} + aa_true "input5 (2nd element of date2)" {[$input5 getAttribute value] eq "1"} + aa_true "input6 (3rd element of date2)" {[$input6 getAttribute value] eq "2011"} + aa_true "input7 (4th element of date2)" {[$input7 getAttribute value] eq "20"} + aa_true "input8 (5th element of date2)" {[$input8 getAttribute value] eq "55"} } ################################################################################ @@ -740,7 +753,6 @@ acs::test::reply_has_status_code $d 200 #ns_log notice CONTENT=[::xowiki::test::get_content $d] - acs::test::dom_html root [::xowiki::test::get_content $d] { set id_part F.[string map {: _} $page_name] set input1 [$root selectNodes "//select\[@id='$id_part.date.DD'\]/option\[@value='1'\]"]