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.57 -r1.58 --- openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 24 Nov 2006 10:54:03 -0000 1.57 +++ openacs-4/packages/file-storage/tcl/file-storage-procs.tcl 27 Nov 2006 13:21:05 -0000 1.58 @@ -294,13 +294,19 @@ if {[empty_string_p $creation_ip]} { set creation_ip [ns_conn peeraddr] } - + + # If the package_id is empty, try the package_id from the parent_object if {$package_id eq ""} { set package_id [acs_object::package_id -object_id $parent_id] - if {[apm_package_key_from_id $package_id] ne "file-storage"} { - set package_id "" + + # If the package_id from the parent_id exists, make sure it is a file-storage package_id + if {$package_id ne ""} { + if {[apm_package_key_from_id $package_id] ne "file-storage"} { + set package_id "" + } } } + set folder_id [content::folder::new -name $name -label $pretty_name -parent_id $parent_id -creation_user $creation_user -creation_ip $creation_ip -description $description -package_id $package_id] permission::grant -party_id $creation_user -object_id $folder_id -privilege "admin"