Index: openacs-4/packages/xowiki/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/notification-procs.tcl,v diff -u -N -r1.21 -r1.21.2.1 --- openacs-4/packages/xowiki/tcl/notification-procs.tcl 15 Jun 2015 19:21:06 -0000 1.21 +++ openacs-4/packages/xowiki/tcl/notification-procs.tcl 9 Feb 2016 11:53:19 -0000 1.21.2.1 @@ -100,19 +100,38 @@ if {![info exists page]} { set page [::xowiki::Package instantiate_page_from_id -revision_id $revision_id] $page volatile + } else { + set revision_id [$page set revision_id] } + + #ns_log notice "--n notification proc called for page [$page name] (revision_id $revision_id) in state [$page publish_status]" if {[$page set publish_status] eq "production"} { - # don't do notification for pages under construction - #ns_log notice "--n xowiki::notification NO NOTIFCATION due to production state" + # + # Don't do notification for pages under construction. + # + ns_log notice "--n xowiki::notification NO notification due to production state" return } $page absolute_links 1 - if {![info exists html]} {set html [$page render]} - if {![info exists text]} {set text [ad_html_text_convert -from text/html -to text/plain -- $html]} + if {![info exists html]} { + set html [$page notification_render] + } + + if {$html eq ""} { + # + # The notification renderer returned empty. Nothing to do. + # + #ns_log notice "--n notification renderer returned emtpy for page [$page name] (revision_id $revision_id). Nothing to do" + return + } + + if {![info exists text]} { + set text [ad_html_text_convert -from text/html -to text/plain -- $html] + } - #ns_log notice "--n xowiki::notification::do_notifications called for item_id [$page set revision_id] publish_status=[$page set publish_status] XXX" + #ns_log notice "--n xowiki do_notifications called for revision_id $revision_id publish_status=[$page set publish_status]" $page instvar package_id set link [$page pretty_link -absolute 1] append html "

For more details, see [ns_quotehtml [$page set title]]

"