Index: openacs-4/packages/attachments/attachments.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/attachments.info,v diff -u -r1.2 -r1.3 --- openacs-4/packages/attachments/attachments.info 2 Jul 2002 19:41:20 -0000 1.2 +++ openacs-4/packages/attachments/attachments.info 9 Jul 2002 19:49:32 -0000 1.3 @@ -52,6 +52,7 @@ + Index: openacs-4/packages/attachments/tcl/attachments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/attachments-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/attachments/tcl/attachments-procs.tcl 2 Jul 2002 19:41:20 -0000 1.2 +++ openacs-4/packages/attachments/tcl/attachments-procs.tcl 9 Jul 2002 19:49:32 -0000 1.3 @@ -84,30 +84,35 @@ db_dml delete_attachment {} } + ad_proc -public get_url { + } { + return [parameter::get \ + -package_id [apm_package_id_from_key attachments] \ + -parameter RelativeUrl + ] + } + ad_proc -public add_attachment_url { {-package_id ""} {-object_id:required} {-return_url ""} {-pretty_name ""} } { - # FIXME: absolute URL here!! - return "attach/attach?pretty_object_name=[ns_urlencode $pretty_name]&object_id=$object_id&return_url=[ns_urlencode $return_url]" + return "[attachments::get_url]/attach?pretty_object_name=[ns_urlencode $pretty_name]&object_id=$object_id&return_url=[ns_urlencode $return_url]" } ad_proc -public goto_attachment_url { {-package_id ""} {-object_id:required} {-attachment_id:required} } { - # FIXME: absolute URL! - return "attach/go-to-attachment?object_id=$object_id&attachment_id=$attachment_id" + return "[attachments::get_url]/go-to-attachment?object_id=$object_id&attachment_id=$attachment_id" } ad_proc -public graphic_url { {-package_id ""} } { - # FIXME: absolute URL! - return "" + return "" } ad_proc -public get_attachments { Index: openacs-4/packages/attachments/www/attach.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/attach.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/attachments/www/attach.tcl 2 Jul 2002 19:41:20 -0000 1.2 +++ openacs-4/packages/attachments/www/attach.tcl 9 Jul 2002 19:49:33 -0000 1.3 @@ -24,10 +24,15 @@ } # Load up file storage information - set root_folder_id [attachments::get_root_folder] if {[empty_string_p $folder_id]} { set folder_id $root_folder_id +} + +# sanity check +if {[empty_string_p $folder_id]} { + ad_return_complaint 1 "Error: empty folder_id!" + ad_script_abort } # Check permission