Forum OpenACS CMS: Re: Incomplete notifications in file-storage

Collapse
Posted by Ryan Gallimore on
I've found the problem. The peice of code in file-storage-procs.tcl under fs:do_notifications that walks up the file hierarchy sending notifications is not sending the correct email body strings. Users who had requested notifications on the root folder were receiving stubs for uploads to sub folders:
    # walk through all folders up to the root folder
    while {$folder_id != $root_folder} {
        set parent_id [db_string parent_id "
	select parent_id from cr_items where item_id = :folder_id"]
        notification::new \
            -type_id [notification::type::get_type_id \
                          -short_name fs_fs_notif] \
            -object_id $parent_id \
            -notif_subject "[_ file-storage.lt_File_Storage_Notifica]" \
            -notif_text $new_content
        set folder_id $parent_id
    }
$new_content passed to notification::new was always empty. To fix, simply drop in the text only and html strings instead:
    # walk through all folders up to the root folder. 
	
    while {$folder_id != $root_folder} {
        set parent_id [db_string parent_id "
	            select parent_id from cr_items where item_id = :folder_id"]
        notification::new \
            -type_id [notification::type::get_type_id \
                          -short_name fs_fs_notif] \
            -object_id $parent_id \
            -notif_subject "[_ file-storage.lt_File_Storage_Notifica]" \
            -notif_text $text_version \
	    -notif_html $html_version
        set folder_id $parent_id
    }
Can someone commit this? I don't feel 100% about doing it myself.