Index: openacs-4/packages/file-storage/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/file-add.tcl,v diff -u -r1.17.2.7 -r1.17.2.8 --- openacs-4/packages/file-storage/www/file-add.tcl 31 Jul 2014 08:42:18 -0000 1.17.2.7 +++ openacs-4/packages/file-storage/www/file-add.tcl 6 Aug 2014 16:08:43 -0000 1.17.2.8 @@ -23,12 +23,14 @@ instructions:onevalue } -validate { file_id_or_folder_id { - if {[info exists file_id] - && [string is integer -strict $file_id] - && (![info exists folder_id] || $folder_id eq "")} { - set folder_id [db_string get_folder_id "select parent_id as folder_id from cr_items where item_id=:file_id;" -default ""] + if {[info exists file_id] && ![info exists folder_id]} { + set folder_id [content::item::get_parent_folder -item_id $file_id] + if {$folder_id eq ""} { + ad_complain "The specified file_id is not valid." + return + } } - if {![string is integer -strict $folder_id] || ![fs_folder_p $folder_id]} { + if {![fs_folder_p $folder_id]} { ad_complain "The specified parent folder is not valid." } }