Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -N -r1.43 -r1.44 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 22 Feb 2018 11:12:12 -0000 1.43 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 3 Mar 2018 16:57:12 -0000 1.44 @@ -437,8 +437,8 @@ can be used in place of flags (see ad_page_contract_filter). There's also an interface for pluggable filter rules, which determine - what filters are applied to arguments (see ad_page_contract_filter_rule). + what filters are applied to arguments + (see ad_page_contract_filter_rule).

@@ -451,8 +451,8 @@

Default Values

- Default values are filled in from left to right (or top to - bottom), so it can depend on the values or variables that comes + Default values are filled in from left to right + (or top to bottom), so it can depend on the values or variables that comes before it, like in the example above. Default values are only used when the argument is not supplied, thus you can't use default values to override the empty string. (This behavior has been questioned and may have to @@ -753,7 +753,7 @@ } # If there are no query arguments to process, we're done - if { ![info exists query] || $query eq "" } { + if { $query eq "" } { return } @@ -940,11 +940,11 @@ foreach filter $apc_filters($formal_name) { set ::ad_page_contract_errorkeys [concat $formal_name:$filter $::ad_page_contract_errorkeys] + set filter_proc [ad_page_contract_filter_proc $filter] if { ![info exists apc_filter_parameters($formal_name:$filter)] } { - set filter_ok_p [[ad_page_contract_filter_proc $filter] $formal_name actual_value] + set filter_ok_p [$filter_proc $formal_name actual_value] } else { - set filter_ok_p [[ad_page_contract_filter_proc $filter] $formal_name actual_value \ - $apc_filter_parameters($formal_name:$filter)] + set filter_ok_p [$filter_proc $formal_name actual_value $apc_filter_parameters($formal_name:$filter)] } set ::ad_page_contract_errorkeys [lrange $::ad_page_contract_errorkeys 1 end] @@ -1370,8 +1370,9 @@

The filter proc must return either 1 if it accepts the value or 0 if it rejects it. - Any problem with the value is reported using ad_complain (see documentation - for this). Note: Any modifications you make to value from inside your code block will modify + Any problem with the value is reported using ad_complain + (see documentation for this). Note: + Any modifications you make to value from inside your code block will modify the actual value being set in the page.

@@ -1486,7 +1487,13 @@ @author Lars Pind (lars@pinds.com) @creation-date 25 July 2000 } { - return [lindex [nsv_get ad_page_contract_filters $filter] 1] + # + # No need to go to the nsv causing mutex locks; note, that the + # name of the filter-procs is more or less hardcoded in the + # doc-strings above. + # + return ad_page_contract_filter_proc_$filter + #return [lindex [nsv_get ad_page_contract_filters $filter] 1] } ad_proc ad_page_contract_filter_script { filter } { @@ -1528,10 +1535,11 @@ @creation-date 25 July 2000 } { upvar $value_varname value + set filter_proc [ad_page_contract_filter_proc $filter] if { $parameters eq "" } { - set filter_result [[ad_page_contract_filter_proc $filter] $name value] + set filter_result [$filter_proc $filter] $name value] } else { - set filter_result [[ad_page_contract_filter_proc $filter] $name value $parameters] + set filter_result [$filter_proc $name value $parameters] } if { $filter_result } { ad_page_contract_set_validation_passed $name:$filter