[Bps-public-commit] rt-extension-notificationmatrix branch, master, updated. 2.1-2-g6de9951

Thomas Sibley trs at bestpractical.com
Fri Sep 16 10:42:20 EDT 2011


The branch, master has been updated
       via  6de99513ee7ad560cab2d9f6e28495f2dce01bbd (commit)
      from  4320202aed8880ff7bc31e6b852cde6aaa7b1ddf (commit)

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

- Log -----------------------------------------------------------------
commit 6de99513ee7ad560cab2d9f6e28495f2dce01bbd
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Sep 16 10:42:16 2011 -0400

    Warn if we can't get a txn type

diff --git a/lib/RT/Extension/NotificationMatrix/Rule.pm b/lib/RT/Extension/NotificationMatrix/Rule.pm
index 7122366..60bbea2 100644
--- a/lib/RT/Extension/NotificationMatrix/Rule.pm
+++ b/lib/RT/Extension/NotificationMatrix/Rule.pm
@@ -73,6 +73,14 @@ sub ScripConditionMatched {
     $ConditionObj->Load( $name ) or die;
 
     my $txn_type = $self->TransactionObj->Type;
+
+    unless (defined $txn_type and length $txn_type) {
+        RT->Logger->error(
+            sprintf "Empty transaction type in %s for txn %d. Wrong current user?",
+                    ref $self, $self->TransactionObj->Id
+        );
+    }
+
     return unless( $ConditionObj->ApplicableTransTypes =~ /(?:^|,)(?:Any|\Q$txn_type\E)(?:,|$)/i );
     # Load the scrip's Condition object
     $ConditionObj->LoadCondition(

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



More information about the Bps-public-commit mailing list