Index: openacs-4/packages/file-storage/tcl/file-storage-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.tcl,v
diff -u -r1.90.2.24 -r1.90.2.25
--- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 14 Sep 2021 18:04:14 -0000 1.90.2.24
+++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 4 Feb 2022 13:40:01 -0000 1.90.2.25
@@ -1519,7 +1519,23 @@
@return package_id
} {
- return [db_string select_package_id {}]
+ return [db_string select_package_id {
+ with recursive hierarchy as
+ (
+ select package_id, context_id
+ from acs_objects
+ where object_id = :file_id
+
+ union
+
+ select o.package_id, o.context_id
+ from acs_objects o, hierarchy h
+ where object_id = h.context_id
+ and h.package_id is null
+ )
+ select package_id from hierarchy
+ where package_id is not null
+ } -default ""]
}
namespace eval fs::notification {}
Index: openacs-4/packages/file-storage/tcl/file-storage-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs.xql,v
diff -u -r1.22.2.2 -r1.22.2.3
--- openacs-4/packages/file-storage/tcl/file-storage-procs.xql 9 Sep 2021 13:48:25 -0000 1.22.2.2
+++ openacs-4/packages/file-storage/tcl/file-storage-procs.xql 4 Feb 2022 13:40:02 -0000 1.22.2.3
@@ -139,14 +139,6 @@
-
-
- select package_id
- from acs_objects
- where object_id = :file_id
-
-
-
select count(*) from cr_items