Index: openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl,v diff -u -r1.36.2.6 -r1.36.2.7 --- openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 9 Apr 2021 07:00:35 -0000 1.36.2.6 +++ openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 20 Apr 2021 11:42:57 -0000 1.36.2.7 @@ -816,7 +816,7 @@ Export the content of the provided revision to the named file in the file system. } { - ::content::revision::write_to_filesystem-$storage_type \ + ::content::revision::export_to_filesystem-$storage_type \ -revision_id $revision_id \ -filename $filename } Index: openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl,v diff -u -r1.10.2.13 -r1.10.2.14 --- openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 13 Apr 2021 16:37:41 -0000 1.10.2.13 +++ openacs-4/packages/file-storage/tcl/test/file-storage-procs.tcl 20 Apr 2021 11:42:57 -0000 1.10.2.14 @@ -9,6 +9,48 @@ aa_register_case \ -cats {web smoke} \ -procs { + fs::publish_versioned_object_to_file_system + } \ + fs_publish_file { + + Test that exporting a file to the filesystem works. + + } { + + aa_run_with_teardown -rollback -test_code { + db_1row get_folder { + select folder_id, package_id + from fs_root_folders + fetch first 1 rows only + } + + set tmp_filename [ad_tmpnam] + set content "This is a test file" + set wfd [open $tmp_filename w] + puts $wfd $content + close $wfd + + set revision_id [fs::add_file \ + -name __test_fs_publish_file \ + -parent_id $folder_id \ + -package_id $package_id \ + -tmp_filename $tmp_filename] + set item_id [db_string get_item_id { + select item_id from cr_revisions + where revision_id = :revision_id + }] + + set exported [fs::publish_versioned_object_to_file_system \ + -object_id $item_id] + + aa_equals "Original and exported files are identical" \ + [ns_md file $tmp_filename] [ns_md file $exported] + } + } + +aa_register_case \ + -cats {web smoke} \ + -procs { file_storage::test::create_new_folder file_storage::test::delete_current_folder acs::test::follow_link