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 {}