Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 10 Jan 2007 21:22:12 -0000 1.27 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 7 Oct 2008 23:26:45 -0000 1.28 @@ -760,7 +760,18 @@ set column [lindex $args 1] # Set an array reference if no column is specified if {$column eq {}} { - uplevel "upvar $multirow_level_up $name:$index $name" + + # If -local was specified, the upvar is done with a relative stack frame + # index, and we must take into account the fact that the uplevel moves up + # the frame one level. If -local was not specified, the an absolute stack + # frame is passed to upvar, which of course needs no adjustment. + + if { $local_p } { + uplevel "upvar [expr { $multirow_level_up - 1 }] $name:$index $name" + } else { + uplevel "upvar $multirow_level_up $name:$index $name" + } + } else { # If a column is specified, just return the value for it upvar $multirow_level_up $name:$index arr