[Bps-public-commit] rt-extension-notificationmatrix branch, master, updated. 2.0-2-g01acf08

Thomas Sibley trs at bestpractical.com
Wed Sep 14 16:42:41 EDT 2011


The branch, master has been updated
       via  01acf0807ca951a87ce9db0cd08a75e8f611a5e3 (commit)
      from  7411eceb94c022a59ca3c8e57f7c035335c7f7f8 (commit)

Summary of changes:
 lib/RT/Extension/NotificationMatrix/Rule.pm |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 01acf0807ca951a87ce9db0cd08a75e8f611a5e3
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Sep 14 16:25:43 2011 -0400

    The recipient hints must be generated after all the Prepares are run
    
    This ensures all recipient munging is finished before we collect the
    list of recipients, and fixes a potential warning caused by
    Email::Address->parse(...) returning an empty list inside the arguments
    hash to $m->callback:
    
        Odd number of elements in hash assignment at
        /opt/rt3/bin/../lib/RT/Interface/Web/Request.pm line 139.
    
    The hints are used by core PreviewScrips in 3.8.9+ and by any patched
    3.8.8's.

diff --git a/lib/RT/Extension/NotificationMatrix/Rule.pm b/lib/RT/Extension/NotificationMatrix/Rule.pm
index c60a94f..7122366 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule.pm
@@ -185,13 +185,6 @@ sub Prepare {
 
     $self->{__email} = [($self->PrepareInternal(), $self->PrepareExternal())];
 
-    # XXX: This hints key is never used.  What's the purpose?
-    $self->{hints} = { class => 'SendEmail',
-                       recipients => { To =>  [ map { @{$_->{To}} } @{$self->{__email}} ],
-                                       Cc =>  [ map { @{$_->{Cc}} } @{$self->{__email}} ],
-                                       Bcc => [ map { @{$_->{Bcc}} } @{$self->{__email}} ],
-                                   } };
-
     # Remove any internal recipients from external notifications by cascading
     # down the array of emails
     for my $i (0 .. $#{$self->{__email}}) {
@@ -235,6 +228,14 @@ sub Prepare {
         }
     }
 
+    # These hints are used by PreviewScrips and must be generated after
+    # all the Prepares are run
+    $self->{hints} = { class => 'SendEmail',
+                       recipients => { To =>  [ map { @{$_->{To}} } @{$self->{__email}} ],
+                                       Cc =>  [ map { @{$_->{Cc}} } @{$self->{__email}} ],
+                                       Bcc => [ map { @{$_->{Bcc}} } @{$self->{__email}} ],
+                                   } };
+
     return 1;
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list