Commit 656168c5 authored by Frank Bergmann's avatar Frank Bergmann

- Added tests for Salo

parent fd8b22f3
......@@ -17,6 +17,11 @@ if {"" eq $file_id && "" ne $version_id} {
set file_id [db_string cr_item "select item_id from cr_revisions where revision_id = :version_id" -default ""]
}
if {"" eq $version_id && "" ne $file_id} {
set version_id [content::item::get_live_revision -item_id $file_id]
}
# Get the paths
set revision_id $version_id
set the_root $::acs::pageroot
......@@ -27,6 +32,29 @@ set template_root [db_string template_root "select content_template__get_root_fo
set user_id [ad_conn user_id]
set storage_area_key "CR_FILES"
set path [cr_fs_path $storage_area_key]
set filename [db_string filename "select :path || content from cr_revisions where revision_id = :version_id"]
set binary_content ""
if {[catch {
set fl [open $filename]
fconfigure $fl -encoding binary
set binary_content [read $fl]
close $fl
} err]} {
ad_return_complaint 1 "Unable to open file $wordcount_file:<br><pre>\n$err</pre>"
ad_script_abort
}
ad_return_complaint 1 "$path - $filename - len=[string length $binary_content] - sha1=[ns_sha1 $binary_content]"
# Serve the page
# DRB: Note that content::init modifies the local variable the_root, which is treated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment