Index: openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl,v diff -u -r1.20.2.1 -r1.20.2.2 --- openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 3 Jul 2020 07:27:29 -0000 1.20.2.1 +++ openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 25 Aug 2020 14:54:20 -0000 1.20.2.2 @@ -314,24 +314,42 @@ content_folder is_sub_folder] } -ad_proc content::folder::get_folder_from_package { +ad_proc -deprecated content::folder::get_folder_from_package { -package_id:required } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-06 Returns the folder_id of the package instance. Cached + + DEPRECATED: this proc assumes there will be just one folder for + each package, which is not true in general! + + @see other packages as file-storage or xowiki define the concept + of a root_folder. This is explicitly meant to be unique for + each package. If your package can guarantee there will only + be one folder per package, you should write your own api for + it. } { return [util_memoize [list content::folder::get_folder_from_package_not_cached -package_id $package_id]] } -ad_proc -private content::folder::get_folder_from_package_not_cached { +ad_proc -deprecated content::folder::get_folder_from_package_not_cached { -package_id:required } { @author Timo Hentschel (timo@timohentschel.de) @creation-date 2005-01-06 Returns the folder_id of the package instance + + DEPRECATED: this proc assumes there will be just one folder for + each package, which is not true in general! + + @see other packages as file-storage or xowiki define the concept + of a root_folder. This is explicitly meant to be unique for + each package. If your package can guarantee there will only + be one folder per package, you should write your own api for + it. } { return [db_string get_folder_id { select folder_id from cr_folders where package_id = :package_id Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v diff -u -r1.41 -r1.41.2.1 --- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 30 Jun 2018 21:08:42 -0000 1.41 +++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 25 Aug 2020 14:54:20 -0000 1.41.2.1 @@ -501,6 +501,16 @@ return $time } +ad_proc as::assessment::folder_id_not_cached { + -package_id:required +} { + Returns the folder_id of the package instance. Not cached. +} { + return [db_string get_folder_id { + select folder_id from cr_folders where package_id = :package_id + }] +} + ad_proc as::assessment::folder_id { -package_id:required } { @@ -510,7 +520,7 @@ Returns the folder_id of the package instance. Cached } { ns_log notice "assessment folder id package_id = '${package_id}'" - return [content::folder::get_folder_from_package -package_id $package_id] + return [util_memoize [list as::assessment::folder_id_not_cached -package_id $package_id]] } ad_proc as::assessment::unique_name {