Index: openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl 8 May 2019 14:22:01 -0000 1.6.2.1 +++ openacs-4/packages/xotcl-core/tcl/04-library-procs.tcl 9 Mar 2022 08:23:42 -0000 1.6.2.2 @@ -80,7 +80,7 @@ #:log "--loaded = [lsort [nsv_array names [self]-loaded]]" if {![nsv_exists [self]-loaded $otherfile]} { - :log "--sourcing $otherfile" + :log "--sourcing first $otherfile" apm_source $otherfile nsv_set [self]-loaded $otherfile 1 } @@ -104,8 +104,10 @@ #:log "--check nsv_exists $vn $dirname/$myfile [nsv_exists $vn $dirname/$myfile]" if {[nsv_exists $vn $dirname/$myfile]} { foreach file [nsv_get $vn $dirname/$myfile] { - :log "--sourcing dependent $file" + incr ::__source_dependent_level + ns_log notice "--sourcing dependent ($::__source_dependent_level) $myfile -> $file" apm_source $file + incr ::__source_dependent_level -1 } } } Index: openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl,v diff -u -r1.70.2.31 -r1.70.2.32 --- openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 8 Mar 2022 11:04:16 -0000 1.70.2.31 +++ openacs-4/packages/xotcl-core/tcl/30-widget-procs.tcl 9 Mar 2022 08:23:42 -0000 1.70.2.32 @@ -822,22 +822,29 @@ # adp-level, which is less robust and warn about this usage. # set ordered_composite [${:__parent} info parent] - if {[::nsf::is object $ordered_composite] && - [$ordered_composite hasclass ::xo::OrderedComposite] && - [$ordered_composite exists __orderby] && - [$ordered_composite exists __order] - } { - set ordered_composite_orderby [$ordered_composite set __orderby] - set ordered_composite_order [$ordered_composite set __order] - if {$ordered_composite_order eq "increasing"} { - set orderby $ordered_composite_orderby,asc - set new_orderby $ordered_composite_orderby,desc + if {[::nsf::is object $ordered_composite] && [$ordered_composite hasclass ::xo::OrderedComposite]} { + if {![$ordered_composite exists __orderby] || ![$ordered_composite exists __order]} { + # + # Tables must always have a defined ordering to ensure stable + # appearance and correct setup of sorting arrows. + # + ad_log warning "downstream application issue: invalid usage of ordered composiste:", \ + "definition of ordering is missing (call method 'orderby' on the ordered composite)." + set orderby "" + set neworderby "" } else { - set orderby $ordered_composite_orderby,desc - set new_orderby $ordered_composite_orderby,asc + set ordered_composite_orderby [$ordered_composite set __orderby] + set ordered_composite_order [$ordered_composite set __order] + if {$ordered_composite_order eq "increasing"} { + set orderby $ordered_composite_orderby,asc + set new_orderby $ordered_composite_orderby,desc + } else { + set orderby $ordered_composite_orderby,desc + set new_orderby $ordered_composite_orderby,asc + } } } else { - ns_log warning "renderSortLabels is still relying on addressing variables on the template::adp_level" + ad_log warning "renderSortLabels is still relying on addressing variables on the template::adp_level" set lvl [template::adp_level] if {$lvl ne ""} { upvar #$lvl $orderby_name orderby