Index: openacs-4/packages/fs-portlet/www/fs-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/www/fs-portlet.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/fs-portlet/www/fs-portlet.tcl 29 Jun 2018 17:27:19 -0000 1.34 +++ openacs-4/packages/fs-portlet/www/fs-portlet.tcl 3 Sep 2024 15:37:39 -0000 1.35 @@ -46,19 +46,22 @@ set user_root_folder [dotlrn_fs::get_user_root_folder -user_id $user_id] set user_root_folder_present_p 0 -if {$user_root_folder ne "" && $user_root_folder in $list_of_folder_ids} { +if {$user_root_folder ne "" && ($user_root_folder in $list_of_folder_ids || $list_of_folder_ids == 0)} { set folder_id $user_root_folder set user_root_folder_present_p 1 set use_ajaxfs_p 0 set file_storage_package_id "" } else { set folder_id [lindex $list_of_folder_ids 0] - set file_storage_node_id [site_node::get_node_id_from_object_id \ - -object_id [ad_conn package_id]] - set file_storage_package_id [site_node::get_children \ - -package_key file-storage \ - -node_id $file_storage_node_id \ - -element package_id] + # + # Get the file-storage instance mounted underneath our node. Note + # that, in theory, multiple instances might be mounted, but this + # portlet's logics will assume only one exist in practice. + # + set file_storage_package_id [lindex [site_node::get_children \ + -package_key "file-storage" \ + -element object_id \ + -node_id [ad_conn node_id]] 0] set use_ajaxfs_p [parameter::get -package_id $file_storage_package_id -parameter UseAjaxFs -default 0] }