Index: openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/01-database-procs.tcl,v diff -u -r1.1.2.50 -r1.1.2.51 --- openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 20 Apr 2023 15:49:48 -0000 1.1.2.50 +++ openacs-4/packages/acs-tcl/tcl/01-database-procs.tcl 17 Nov 2023 13:32:36 -0000 1.1.2.51 @@ -1964,11 +1964,17 @@

- If the -local is passed, the variables defined - by db_multirow will be set locally (useful if you're compiling dynamic templates - in a function or similar situations). Use the -upvar_level - switch to specify how many levels up the variable should be set. + If the -local is passed, the variables defined by + db_multirow will be set locally (useful if you're compiling + dynamic templates in a function or similar situations). Use the + -upvar_level switch to specify how many levels up the + variable should be set. + The default behavior (i.e., when no "-local" is specified) depends + on the calling environment: when "db_multirow" is called from an + ADP file the variables are set in the ADP environment. Otherwise, + the default behavior is "-local". +

You may supply a code block, which will be executed for each row in @@ -2003,9 +2009,9 @@

- Notice the nonstandard numbering (everything - else in Tcl starts at 0); the reason is that the graphics designer, a non - programmer, may wish to work with row numbers. + Notice the nonstandard numbering (everything else in Tcl starts at + 0); the reason is that the graphics designer, a non-programmer, + may wish to work with row numbers.

@@ -2021,10 +2027,16 @@ # Query Dispatcher (OpenACS - ben) set full_statement_name [db_qd_get_fullname $statement_name] - if { $local_p } { + # + # When this function is called outside ADP, fall back to "-local" + # behavior. + # + set adpLevel [template::adp_level] + + if { $local_p || $adpLevel eq ""} { set level_up $upvar_level } else { - set level_up \#[template::adp_level] + set level_up \#$adpLevel } ad_arg_parser { bind args } $args