Index: openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl,v diff -u -r1.8.2.10 -r1.8.2.11 --- openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl 29 Mar 2022 16:03:35 -0000 1.8.2.10 +++ openacs-4/packages/xowf/tcl/xowf-form-field-procs.tcl 12 Aug 2022 16:41:15 -0000 1.8.2.11 @@ -36,8 +36,10 @@ $ctx initialize_context ${:object} ${:object} wf_context $ctx unset errorMsg - array set "" [$ctx check] - if {$(rc) == 1} {set errorMsg $(errorMsg)} + set info [$ctx check] + if {[dict get $info rc] == 1} { + set errorMsg [dict get $info errorMsg] + } } if {[info exists errorMsg]} { Index: openacs-4/packages/xowf/tcl/xowf-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-procs.tcl,v diff -u -r1.28.2.77 -r1.28.2.78 --- openacs-4/packages/xowf/tcl/xowf-procs.tcl 24 Jun 2022 12:51:39 -0000 1.28.2.77 +++ openacs-4/packages/xowf/tcl/xowf-procs.tcl 12 Aug 2022 16:41:15 -0000 1.28.2.78 @@ -669,7 +669,7 @@ ns_log error "Error in workflow definition ([${:object} name]): $errorMsg\n$::errorInfo\n\ ===== default_definition: [:default_definition] \n\ ===== workflow_definition: $workflow_definition" - :msg -html t "Error in workflow definition: [ns_quotehtml $errorMsg]" + :msg -html t "Error in workflow definition of [${:object} name]: [ns_quotehtml $errorMsg]" } # @@ -868,9 +868,21 @@ } } + # + # In most cases, the package_id is initialized here already + # + set package_id [$obj package_id] + #:log "... OBJECT $obj HAS $package_id /[info commands ::$package_id/]" + if {[info commands ::$package_id] eq ""} { + :log "... OBJECT $obj HAS $package_id, which is not initialized yet" + xo::Package require $package_id + } + + # # Set the embedded_context to the workflow context, - # used e.g. by "behavior" of form-fields - [[$obj package_id] context] set embedded_context [self] + # used e.g. by "behavior" of form-fields. + # + [::$package_id context] set embedded_context [self] set stateObj ${:current_state} catch {$stateObj eval [$stateObj eval_when_active]} @@ -1085,8 +1097,10 @@ foreach role [array names :handled_roles] { set role_ctx [self]-$role if {[nsf::is object $role_ctx]} { - array set "" [$role_ctx check] - if {$(rc) == 1} {return [array get ""]} + set info [$role_ctx check] + if {[dict get $info rc] == 1} { + return $info + } array set :forms [$role_ctx array get forms] array set :parampage [$role_ctx array get parampage] }