Index: openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl,v diff -u -r1.9.2.4 -r1.9.2.5 --- openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl 26 Dec 2020 16:17:55 -0000 1.9.2.4 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl 26 Dec 2020 16:39:05 -0000 1.9.2.5 @@ -54,17 +54,21 @@ @return The possibly-cached value returned by script. } { # - # The ::util_memoize_flush proc is defined in the *-init script, - # after the util_memoize cache was created. Therefore, is safe to - # use the util_memoize when this proc is available. + # When util_memoize is called before the cache is created dont + # raise an error but eval without caching. # - if {[namespace which ::util_memoize_flush] ne ""} { + # The AOLserver version of the proc says "no uplevel", so do not + # uplevel here either. + # + # https://github.com/openacs/openacs-core/blob/master/packages/acs-tcl/tcl/memoize-procs-aolserver.tcl#L16 + # + if {[ns_cache_exists util_memoize]} { if {$max_age ne ""} { set max_age "-expires $max_age" } ns_cache_eval {*}$max_age -- util_memoize $script [list eval $script] } else { - uplevel $script + eval $script } }