Forum OpenACS CMS: Incomplete notifications in file-storage

When a file is uploaded to file storage, I receive a notification that looks like this:
Subject: File Storage Notification

Notification for: File-Storage: New File Uploaded 
File-Storage folder: FS Folder 
Name of the New File Uploaded: UploadedFile 
Uploaded by: Site Wide Admin 2
View folder contents: http://mysite.com/file-storage/?folder_id=1234
But user "Site Wide Admin 2" receives only a stub:
Subject: File Storage Notification

Getting too much email? Manage your notifications at:
http://intranet.campus-coop.org/notifications/manage
Any reason for this? The notification is being built for sure, but how could only a portion of it be mailed to a particuilar user? Site Wide Admin 2 is on the same LAN as the server...
Collapse
Posted by Malte Sussdorff on
Good question. I was wondering about this myself but decided not to bother any further. Here must be something in the code that differs for SWA.
Collapse
Posted by Ryan Gallimore on
Yes but I am a SWA, and I receive the complete notification.
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.
Collapse
Posted by Malte Sussdorff on
This has been commited.