Index: openacs-4/packages/attachments/www/go-to-attachment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v diff -u -r1.2.2.2 -r1.2.2.3 --- openacs-4/packages/attachments/www/go-to-attachment.tcl 20 Mar 2003 22:12:18 -0000 1.2.2.2 +++ openacs-4/packages/attachments/www/go-to-attachment.tcl 26 May 2003 21:39:13 -0000 1.2.2.3 @@ -12,12 +12,13 @@ permission::require_permission -object_id $object_id -privilege read # Get information about attachment -if {![db_0or1row select_attachment_data {}]} { - ad_return_complaint "No such attachment for this object" +set content_type [item::get_type $attachment_id] +if { [string length $content_type] == 0 } { + ad_return_complaint 1 "No such attachment for this object" return } -switch $object_type { +switch $content_type { content_extlink { ad_returnredirect [db_string select_url {}] ad_script_abort @@ -32,7 +33,7 @@ } default { - ad_return_complaint "don't know how to deal with this attachment type" + ad_return_complaint 1 "don't know how to deal with this attachment type" return } }