Index: openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 20 Oct 2005 16:05:34 -0000 1.17 +++ openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl 20 Oct 2005 16:17:52 -0000 1.18 @@ -157,8 +157,18 @@ @error } { set community_id [dotlrn_community::get_community_id] - set project_id [wieners::process::project_from_project_folder -folder_id $folder_id] + # Try to retrieve the project_id from the folder + set project_id [db_string get_project_id_from_folder { + select r.object_id_two as project_id + from acs_rels r, cr_items i, cr_items p + where i.item_id = :folder_id + and r.object_id_one = i.parent_id + and r.rel_type = 'application_data_link' + and r.object_id_two = p.item_id + and p.content_type = 'pm_project' + } -default "0"] + if {[empty_string_p $project_id]} { # no project -> mail to all organization contacts set contact_organizations [application_data_link::get_linked -from_object_id $community_id -to_object_type "organization"]