Index: openacs-4/packages/xowiki/tcl/folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/folder-procs.tcl,v diff -u -r1.39 -r1.40 --- openacs-4/packages/xowiki/tcl/folder-procs.tcl 19 Nov 2017 12:32:26 -0000 1.39 +++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 21 Dec 2017 20:44:58 -0000 1.40 @@ -613,7 +613,9 @@ $name] array set icon [$c render_icon] - if {[catch {set prettyName [$c pretty_name]} errorMsg]} { + ad_try { + set prettyName [$c pretty_name] + } on error {errorMsg} { :msg "can't obtain pretty name of [$c item_id] [$c name]: $errorMsg" set prettyName $name } Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.253 -r1.254 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 15 Dec 2017 15:40:49 -0000 1.253 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 21 Dec 2017 20:44:58 -0000 1.254 @@ -1436,20 +1436,25 @@ set :is_integer [regexp {%[0-9.]*d} [:format]] } numeric instproc convert_to_external value { - if {$value ne ""} { - if { [catch "lc_numeric $value [:format] [:locale]" result] } { - util_user_message -message "[:label]: $result (locale=[:locale])" - #my msg [list lc_numeric $value [:format] [:locale]] - set converted_value $value - if {[catch {scan $value [:format] converted_value}]} { - return $value - } else { - return $converted_value - } + if {$value eq ""} { + set result "" + } else { + ad_try { + return [lc_numeric $value [:format] [:locale]] + } on error errorMsg { + util_user_message -message "[:label]: $errorMsg (locale=[:locale])" } - return $result + # + # try again + # + set converted_value $value + ad_try { + scan $value [:format] result + } on error {errMsg} { + set result $value + } } - return $value + return $result } numeric instproc convert_to_internal {} { if {[:value] ne ""} { @@ -3149,13 +3154,15 @@ fconfigure $f translation binary set img [read $f] close $f - } elseif {[catch { - set request [util::http::get -url $value] - set img [expr {[dict exists $request page] ? [dict get $request page] : ""}] - } errorMsg]} { - # cannot transfer image - :log "--img cannot tranfer image '$value' ($errorMsg)" - return 0 + } else { + ad_try { + set request [util::http::get -url $value] + set img [expr {[dict exists $request page] ? [dict get $request page] : ""}] + } on error {errorMsg} { + # cannot transfer image + :log "--img cannot obtain image '$value' ($errorMsg)" + return 0 + } } #my msg "guess mime_type of $entry_name = [::xowiki::guesstype $entry_name]" set import_file [ad_tmpnam] Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.303 -r1.304 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 21 Dec 2017 18:09:40 -0000 1.303 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 21 Dec 2017 20:44:58 -0000 1.304 @@ -485,7 +485,7 @@ set encoded_name "" } else { if {$parent_id eq ""} { - ns_log notice "pretty_link of $name: you should consider to pass a parent_id to support folders" + ns_log warning "pretty_link of $name: you should consider to pass a parent_id to support folders" set parent_id [:folder_id] } set folder [:folder_path -parent_id $parent_id -folder_ids $folder_ids -path_encode $path_encode] @@ -818,12 +818,12 @@ } else { # determine privilege from policy #my msg "-- check permissions from ${:id} of object $object $method" - if {[catch { + ad_try { set granted [:check_permissions \ -user_id $party_id \ -package_id ${:id} \ -link $computed_link $object $method] - } errorMsg ]} { + } on error {errorMsg} { ns_log error "error in check_permissions: $errorMsg" set granted 0 } @@ -932,28 +932,22 @@ } } - #ns_log notice "call procsearch www-$method on: [$page_or_package info precedence]" + #:log "call procsearch www-$method on: [$page_or_package info precedence]" if {[$page_or_package procsearch www-$method] eq ""} { return [:error_msg "Method '[ns_quotehtml $method]' is not defined for this object"] } else { - #my log "--invoke ${:object} id=$page_or_package method=$method (${:id} batch_mode $batch_mode)" + #:log "--invoke ${:object} id=$page_or_package method=$method (${:id} batch_mode $batch_mode)" - if {$batch_mode} {${:id} set __batch_mode 1} - set err [catch { set r [:call $page_or_package $method ""]} errorMsg] - if {$err} {set errorCode $::errorCode} - if {$batch_mode} {${:id} unset -nocomplain __batch_mode} - if {$err} { - # - # Check, if we were called from "ad_script_abort" (intentional abortion) - # - if {[ad_exception $errorCode] eq "ad_script_abort"} { + if {$batch_mode} { + ${:id} set __batch_mode 1 + } + + ad_try { + set r [:call $page_or_package $method ""] + } on error {errorMsg} { + if {[string match "*for parameter*" $errorMsg]} { # - # Yes, this was an intentional abortion - # - return "" - } elseif {[string match "*for parameter*" $errorMsg]} { - # # The exception might have been due to invalid input parameters # ad_return_complaint 1 [ns_quotehtml $errorMsg] @@ -967,7 +961,13 @@ -template_file $error_template \ "error during [ns_quotehtml $method]:
[ns_quotehtml $errorMsg]
"] } + + } finally { + if {$batch_mode} { + ${:id} unset -nocomplain __batch_mode + } } + return $r } } else { @@ -1990,7 +1990,7 @@ select item_id from cr_items where name = :name and parent_id = :parent_id }] if {$old_folder_id ne ""} { - ns_log notice "-- try to transform old root folder $old_folder_id of package ${:id}" + :log "-- try to transform old root folder $old_folder_id of package ${:id}" ::xowiki::transform_root_folder ${:id} set folder_id $old_folder_id } else { @@ -2433,7 +2433,7 @@ if {$item_id eq ""} { array set "" [:item_info_from_url -with_package_prefix false $name] if {$(item_id) == 0} { - ns_log notice "url lookup of '$name' failed" + :log "www-delete: url lookup of '$name' failed" } else { set parent_id $(parent_id) set item_id $(item_id) @@ -2568,7 +2568,7 @@ default {error "unknown scope for flushing page fragment cache"} } foreach entry [ns_cache names xowiki_cache $key] { - ns_log notice "::xo::clusterwide ns_cache flush xowiki_cache $entry" + #:log "::xo::clusterwide ns_cache flush xowiki_cache $entry" ::xo::clusterwide ns_cache flush xowiki_cache $entry } } @@ -2589,7 +2589,7 @@ return [::xo::cc cache_set $key [next]] } else { # in case, we have no ::xo::cc (e.g. during bootstrap). - ns_log notice "warning: no ::xo::cc available, returning default for parameter $attribute" + ns_log warning "no ::xo::cc available, returning default for parameter $attribute" return $default } } Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.72 -r1.73 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 21 Oct 2017 17:58:35 -0000 1.72 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 21 Dec 2017 20:44:58 -0000 1.73 @@ -247,8 +247,9 @@ if {[$p info mixin] ne ""} {$p mixin {}} if {[info exists :entry_flag]} {$p set [:entry_flag] 1} if {[:no_footer]} {$p set __no_footer 1} - # if {[catch {$p set description [$p render]} errorMsg]} {} - if {[catch {$p set description [$p render -with_footer false]} errorMsg]} { + ad_try { + $p set description [$p render -with_footer false] + } on error {errorMsg} { $p set description "Render Error ($errorMsg) $revision_id $name $title" } if {[info exists :entry_flag]} {$p unset [:entry_flag]} 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.500 -r1.501 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 21 Dec 2017 18:09:41 -0000 1.500 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 21 Dec 2017 20:44:58 -0000 1.501 @@ -812,22 +812,24 @@ } Page instproc map_party {-property party_id} { - #my log "+++ $party_id" - # So far, we just handle users, but we should support parties in - # the future as well. if {$party_id eq "" || $party_id == 0} { return $party_id } - if {![catch {acs_user::get -user_id $party_id -array info}]} { + ad_try { + acs_user::get -user_id $party_id -array info set result [list] foreach a {username email first_names last_name screen_name url} { lappend result $a $info($a) } - ns_log notice "-- map_party $party_id: $result" + :log "-- map_party $party_id: $result" return $result + } on error {errorMsg} { + # swallow errors; there should be a better way to check if user + # and or group info exists } - if {![catch {group::get -group_id $party_id -array info}]} { - ns_log notice "got group info: [array get info]" + ad_try { + group::get -group_id $party_id -array info + :log "got group info: [array get info]" set result [array get info] set members {} foreach member_id [group::get_members -group_id $party_id] { @@ -836,6 +838,9 @@ lappend result members $members ns_log notice "-- map_party $party_id: $result" return $result + } on error {errorMsg} { + # swallow errors; there should be a better way to check if user + # and or group info exists } ns_log warning "Cannot map party_id $party_id, probably not a user; property $property lost during export" return {} @@ -1072,9 +1077,9 @@ if {[llength $value] != 2} { error "two arguments for match required, [llength $value] passed (arguments='$value')" } - if {[catch { + ad_try { set success [string match [lindex $value 1] [:set [lindex $value 0]]] - } errorMsg]} { + } on error {errorMsg} { ns_log error "error during condition match: $errorMsg" set success 0 } @@ -1100,9 +1105,9 @@ if {[llength $value] != 2} { error "two arguments for regexp required, [llength $value] passed (arguments='$value')" } - if {[catch { + ad_try { set success [regexp [lindex $value 1] [:set [lindex $value 0]]] - } errorMsg]} { + } on error {errorMsg} { ns_log error "error during condition regexp: $errorMsg" set success 0 } @@ -1813,7 +1818,9 @@ set package_id ${:package_id} # do we have a wellformed list? - if {[catch {set page_name [lindex $arg 0]} errMsg]} { + ::try { + set page_name [lindex $arg 0] + } on error {errMsg} { # there must be something syntactically wrong return [:error_in_includelet $arg [_ xowiki.error-includelet-dash_syntax_invalid]] } @@ -1887,13 +1894,13 @@ } # "render" might be cached - if {[catch {set html [$includelet render]} errorMsg]} { + set html "" + ad_try { + set html [$includelet render] + } on error {errorMsg} { set errorCode $::errorCode set errorInfo $::errorInfo - if {[ad_exception $errorCode] eq "ad_script_abort"} { - set html "" - } elseif {[string match "*for parameter*" $errorMsg]} { - set html "" + if {[string match "*for parameter*" $errorMsg]} { ad_return_complaint 1 [ns_quotehtml $errorMsg] } else { ad_log error "render_includelet $includeletClass led to: $errorMsg ($errorCode)\n$errorInfo" @@ -1967,15 +1974,16 @@ } Page instproc include_content {arg ch2} { - # make recursion depth a global variable to ease the deletion etc. - if {[catch {incr ::xowiki_inclusion_depth}]} { - set ::xowiki_inclusion_depth 1 - } - if {$::xowiki_inclusion_depth > 10} { + # + # Recursion depth is a global variable to ease the deletion etc. + # + if {[incr ::xowiki_inclusion_depth] > 10} { return [:error_in_includelet $arg [_ xowiki.error-includelet-nesting_to_deep]]$ch2 } if {[regexp {^adp (.*)$} $arg _ adp]} { - if {[catch {lindex $adp 0} errMsg]} { + try { + lindex $adp 0 + } on error {errMsg} { # there is something syntactically wrong incr ::xowiki_inclusion_depth -1 return [:error_in_includelet $arg [_ xowiki.error-includelet-adp_syntax_invalid]]$ch2 @@ -2003,22 +2011,17 @@ lappend adp_args __including_page [self] set including_page_level [template::adp_level] - if {[catch {set page [template::adp_include $adp_fn $adp_args]} errorMsg]} { - if {[ad_exception $::errorCode] eq "ad_script_abort"} { - # - # If the exception was from an ad_script_abort, propagate it up - # - incr ::xowiki_inclusion_depth -1 - ad_script_abort - } + ad_try { + set page [template::adp_include $adp_fn $adp_args] + } on error {errorMsg} { ad_log error "$errorMsg\n$::errorInfo" # in case of error, reset the adp_level to the previous value set ::template::parse_level $including_page_level - incr ::xowiki_inclusion_depth -1 return [:error_in_includelet $arg \ [_ xowiki.error-includelet-error_during_adp_evaluation]]$ch2 + } finally { + incr ::xowiki_inclusion_depth -1 } - incr ::xowiki_inclusion_depth -1 return $page$ch2 } else { @@ -2235,12 +2238,14 @@ [self]::link href "" } - if {[catch {[self]::link configure {*}$options} errorMsg]} { + ad_try { + [self]::link configure {*}$options + set result [[self]::link] + + } on error {errorMsg} { ns_log error "$errorMsg\n$::errorInfo" set result "
Error during processing of options [list $options]\ of link of type [[self]::link info class]:
$errorMsg
" - } else { - set result [[self]::link] } return $result } @@ -2297,10 +2302,14 @@ } Page instproc anchor {arg} { - if {[catch {set l [:create_link $arg]} errorMsg]} { + ad_try { + set l [:create_link $arg] + } on error {errorMsg} { return "
Error during processing of anchor ${arg}:
$errorMsg
" } - if {$l eq ""} {return ""} + if {$l eq ""} { + return "" + } if {[info exists :__RESOLVE_LOCAL] && [$l is_self_link]} { :set_resolve_context -package_id [:physical_package_id] -parent_id [:physical_parent_id] @@ -2392,22 +2401,30 @@ set __vars [info vars] regsub -all [template::adp_variable_regexp] $content {\1@\2;noquote@} content_noquote #my log "--adp before adp_eval '[template::adp_level]'" - # - # The adp buffer has limited size. For large pages, it might happen - # that the buffer overflows. In AOLserver 4.5, we can increase the - # buffer size. In 4.0.10, we are out of luck. - # + set __l [string length $content] - if {[catch {set __bufsize [ns_adp_ctl bufsize]}]} { + try { + set __bufsize [ns_adp_ctl bufsize] + } on error {errorMsg} { + # + # The adp buffer has limited size. For large pages, it might happen + # that the buffer overflows. In AOLserver 4.5, we can increase the + # buffer size. In 4.0.10, we are out of luck. + # set __bufsize 0 } if {$__bufsize > 0 && $__l > $__bufsize} { - # we have AOLserver 4.5, we can increase the bufsize + # + # We have AOLserver 4.5 or NaviServer , we can increase the + # bufsize + # ns_adp_ctl bufsize [expr {$__l + 1024}] } set template_code [template::adp_compile -string $content_noquote] set my_parse_level [template::adp_level] - if {[catch {set template_value [template::adp_eval template_code]} __errMsg]} { + ad_try { + set template_value [template::adp_eval template_code] + } on error {__errMsg} { # # Something went wrong during substitution; prepare a # user-friendly error message containing a listing of the @@ -2425,7 +2442,7 @@ append __template_variables__ "\n" set ::template::parse_level $my_parse_level #my log "--adp after adp_eval '[template::adp_level]' mpl=$my_parse_level" - return "
Error in Page $name: $__errMsg
$content

Possible values are$__template_variables__" + set template_value "

Error in Page $name: $__errMsg
$content

Possible values are$__template_variables__" } return $template_value } @@ -3513,7 +3530,7 @@ # .... or, we try to resolve it against a local property. # # This case is currently needed in the workflow case, where - # e.g. anon_instances is tried to be catched from the first form, + # e.g. anon_instances is tried to be fetched from the first form, # which might not contain it, if e.g. the first form is a plain # wiki page. # @@ -3594,28 +3611,22 @@ :set_payload ${:text} next } + Object instproc set_payload {cmd} { set payload [self]::payload if {[:isobject $payload]} {$payload destroy} ::xo::Context create $payload -requireNamespace \ -actual_query [::xo::cc actual_query] $payload set package_id ${:package_id} - if {[catch {$payload contains $cmd} errorMsg]} { - set errorCode $::errorCode - if {[ad_exception $errorCode] eq "ad_script_abort"} { - ad_return_complaint 1 [ns_quotehtml $errorMsg] - ns_log notice "xowiki::Object->set_payload aborted" - ad_script_abort - } else { - ad_log error "xowiki::Object set_payload: $errorMsg ($errorCode) in\n$cmd" - } - ad_log error "content $cmd lead to error: $errorMsg" - ::xo::clusterwide ns_cache flush xotcl_object_cache ${:item_id} - } else { - #my log "call init mixins=[:info mixin]//[$payload info mixin]" + ad_try { + $payload contains $cmd $payload init + } on error {errorMsg} { + ad_log error "xowiki::Object set_payload: content $cmd lead to error: $errorMsg" + ::xo::clusterwide ns_cache flush xotcl_object_cache ${:item_id} } } + Object instproc get_payload {var {default ""}} { set payload [self]::payload if {![:isobject $payload]} { @@ -3735,12 +3746,12 @@ # # Create from fields from all specs and report, if there are any errors # - if {[catch { + ad_try { :create_form_fields_from_form_constraints $form_constraints - } errorMsg]} { - ns_log error "error during form_constraints validator: $errorMsg\n$::errorInfo" + } on error {errorMsg} { + ad_log error "error during form_constraints validator: $errorMsg" :uplevel [list set errorMsg $errorMsg] - #my msg "ERROR: invalid spec '$short_spec' for form field '$spec_name' -- $errorMsg" + #:log "ERROR: invalid spec '$short_spec' for form field '$spec_name' -- $errorMsg" return 0 } return 1 @@ -4582,7 +4593,7 @@ Page instproc is_new_entry {old_name} { - return [expr {[:publish_status] eq "production" && $old_name eq [:revision_id]}] + return [expr {${:publish_status} eq "production" && $old_name eq ${:revision_id}}] } Page instproc unset_temporary_instance_variables {} { @@ -4601,7 +4612,7 @@ Page instproc rename {-old_name -new_name} { ${:package_id} flush_name_cache -name $old_name -parent_id ${:parent_id} next - ns_log notice "----- rename" + :log "----- rename <$old_name> to <$new_name>" #ns_log notice [:serialize] } Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 24 Nov 2017 09:19:47 -0000 1.41 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 21 Dec 2017 20:44:58 -0000 1.42 @@ -175,9 +175,9 @@ if {[$package_id get_parameter use_hstore 0] == 0} { continue } - if {[catch { + ad_try { xowiki::hstore::update_form_instance_item_index -package_id $package_id - } errorMsg]} { + } on error {errorMsg} { ns_log Warning "initializing package $package_id lead to error: $errorMsg" } db_release_unused_handles 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.337 -r1.338 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 12 Dec 2017 10:46:31 -0000 1.337 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 21 Dec 2017 20:44:58 -0000 1.338 @@ -32,7 +32,7 @@ } foreach page_name [:form_parameter objects] { set item_id [::xo::db::CrClass lookup -name $page_name -parent_id $parent_id] - ns_log notice "bulk-delete: DELETE $page_name in folder [:name]-> $item_id" + :log "bulk-delete: DELETE $page_name in folder ${:name}-> $item_id" $package_id www-delete -item_id $item_id } $package_id returnredirect . @@ -96,8 +96,10 @@ set clipboard [::xowiki::clipboard get] set item_ids [::xowiki::exporter include_needed_objects $clipboard] set content [::xowiki::exporter marshall_all -mode copy $item_ids] - if {[catch {namespace eval ::xo::import $content} error]} { - :msg "Error: $error\n$::errorInfo" + ad_try { + namespace eval ::xo::import $content + } on error {errMsg} { + :msg "Error: $errMsg\n$::errorInfo" return } set folder_id [expr {[:is_folder_page] ? ${:item_id} : ${:parent_id}}] @@ -137,14 +139,14 @@ # # Initialize the target package and set the variable package_id. # - if {[catch { + ad_try { ::xowiki::Package initialize \ -url $package_instance -user_id [::xo::cc user_id] \ -actual_query "" - } errorMsg]} { - ns_log error "$errorMsg\n$::errorInfo" + } on error {errorMsg} { + ns_log error "Package initialize: $errorMsg\n$::errorInfo" return [$original_package_id error_msg \ - "Page '[:name]' invalid provided package instance=$package_instance

$errorMsg

"] + "Page '${:name}' invalid provided package instance=$package_instance

$errorMsg

"] } } @@ -395,11 +397,13 @@ return "" } ::xo::Page requireCSS /resources/xowiki/xowiki.css - set my_page [::xowiki::Package instantiate_page_from_id -revision_id [:revision_id]] + set my_page [::xowiki::Package instantiate_page_from_id -revision_id ${:revision_id}] $my_page volatile - if {[catch {set html1 [$my_page render]} errorMsg]} { - set html2 "Error rendering [:revision_id]: $errorMsg" + ad_try { + set html1 [$my_page render] + } on error {errorMsg} { + set html1 "Error rendering ${:revision_id}: $errorMsg" } set text1 [ad_html_text_convert -from text/html -to text/plain -- $html1] set user1 [::xo::get_user_name [$my_page set creation_user]] @@ -411,7 +415,9 @@ $other_page volatile #$other_page absolute_links 1 - if {[catch {set html2 [$other_page render]} errorMsg]} { + ad_try { + set html2 [$other_page render] + } on error {errorMsg} { set html2 "Error rendering $compare_id: $errorMsg" } set text2 [ad_html_text_convert -from text/html -to text/plain -- $html2] @@ -424,7 +430,9 @@ set context [list $title] # try util::html diff if it is available and works - if {[catch {set content [::util::html_diff -old $html2 -new $html1 -show_old_p t]}]} { + ad_try { + set content [::util::html_diff -old $html2 -new $html1 -show_old_p t] + } on error {errMsg} { # otherwise, fall back to proven text based diff set content [::xowiki::html_diff $text2 $text1] } @@ -516,7 +524,7 @@ if {![file isdirectory /tmp/$geometry]} { file mkdir /tmp/$geometry } - set scaled_image /tmp/$geometry/[:revision_id] + set scaled_image /tmp/$geometry/${:revision_id} if {![file readable $scaled_image]} { set cmd [::util::which convert] if {$cmd ne ""} { @@ -612,6 +620,7 @@ {-autoname:boolean false} {-validation_errors ""} } { + :instvar package_id item_id revision_id parent_id #:msg "--edit new=$new autoname=$autoname, valudation_errors=$validation_errors, parent=${:parent_id}" :edit_set_default_values @@ -864,7 +873,7 @@ # with highest precedence # set return_url [$package_id query_parameter return_url $url] - #:log "[:name]: url=$url, return_url=$return_url" + #:log "${:name}: url=$url, return_url=$return_url" $package_id returnredirect $return_url return @@ -880,7 +889,7 @@ # # Build the input form and display the current values. # - if {[:is_new_entry [:name]]} { + if {[:is_new_entry ${:name}]} { set :creator [::xo::get_user_name [::xo::cc user_id]] set :nls_language [ad_conn locale] } @@ -892,8 +901,8 @@ # For named entries, just set the entry fields to empty, # without changing the instance variables - #:log "my is_new_entry [:name] = [:is_new_entry [:name]]" - if {[:is_new_entry [:name]]} { + #:log "my is_new_entry ${:name} = [:is_new_entry ${:name}]" + if {[:is_new_entry ${:name}]} { if {$anon_instances} { set basename [::xowiki::autoname basename [${:page_template} name]] set name [::xowiki::autoname new -name $basename -parent_id ${:parent_id}] @@ -972,9 +981,9 @@ # $rootNode insertBeforeFromScript { ::html::div { - ::html::input -type hidden -name __object_name -value [:name] + ::html::input -type hidden -name __object_name -value ${:name} ::html::input -type hidden -name __form_action -value save-form-data - ::html::input -type hidden -name __current_revision_id -value [:revision_id] + ::html::input -type hidden -name __current_revision_id -value ${:revision_id} ::html::CSRFToken } # insert automatic form fields on top @@ -1037,7 +1046,7 @@ } set m [:form_parameter __form_redirect_method "edit"] set url [export_vars -no_base_encode -base [:action_url] {m return_url}] - #:log "=== setting action <$url> for form-action my-name [:name]" + #:log "=== setting action <$url> for form-action my-name ${:name}" $formNode setAttribute action $url method POST role form if {$has_file} {$formNode setAttribute enctype multipart/form-data} Form add_dom_attribute_value $formNode class [${:page_template} css_class_name] @@ -1147,7 +1156,7 @@ # larger form-usages (a few MB) where otherwise # "ad_html_text_convert" in Page.get_description tend to use forever # (at least in Tcl 8.5) - set :description "form-usages for [:name] [:title]" + set :description "form-usages for ${:name} [:title]" return [:www-view [:include [list form-usages -form_item_id ${:item_id}]]] } @@ -1576,8 +1585,10 @@ } } set header_stuff [::xo::Page header_stuff] - #ns_log notice "=== HEADER STUFF <$header_stuff>" - if {![info exists :description]} {set :description [:get_description $content]} + #:log "HEADER STUFF <$header_stuff>" + if {![info exists :description]} { + set :description [:get_description $content] + } if {[info commands ::template::head::add_meta] ne ""} { #set meta(language) [:lang] @@ -1627,10 +1638,11 @@ [array get __adp_properties]]] } } - if {[catch {set content [template::adp_eval template_code]} errmsg]} { - ns_return 200 text/html "Error in Page ${:name}: $errmsg
$template" - } else { + ad_try { + set content [template::adp_eval template_code] ns_return 200 text/html $content + } on error {errMsg} { + ns_return 200 text/html "Error in Page ${:name}: $errMsg
$template" } } else { # use adp file @@ -1770,7 +1782,7 @@ set default "" } set f [::xowiki::formfield::FormField new -name $name \ - -id [::xowiki::Includelet html_id F.[:name].$name] \ + -id [::xowiki::Includelet html_id F.${:name}.$name] \ -locale [:nls_language] \ -label $label \ -type [expr {[$slot exists datatype] ? [$slot set datatype] : "text"}] \ @@ -1861,7 +1873,7 @@ -type select \ -value $value \ -required $require_category_p] - #:msg "category field [:name] created, value '$value'" + #:msg "category field ${:name} created, value '$value'" $f destroy_on_cleanup $f options $options $f multiple [expr {!$assign_single_p}] @@ -2178,7 +2190,7 @@ } #:msg "validation returns $validation_errors errors" set current_revision_id [$cc form_parameter __current_revision_id ""] - if {$validation_errors == 0 && $current_revision_id ne "" && $current_revision_id != [:revision_id]} { + if {$validation_errors == 0 && $current_revision_id ne "" && $current_revision_id != ${:revision_id}} { set validation_errors [:mutual_overwrite_occurred] } @@ -2392,13 +2404,7 @@ } } - if {[apm_version_names_compare [ad_acs_version] 5.3.0] == 1} { - ns_log notice "Zen-state: 5.3.2 or newer" - Form set extraCSS "" - } else { - ns_log notice "Zen-state: pre 5.3.1, use backward compatible form css file" - Form set extraCSS "zen-forms-backward-compatibility.css" - } + Form set extraCSS "" Form proc requireFormCSS {} { #:msg requireFormCSS set css ${:extraCSS}