[freeside-commits] branch FREESIDE_4_BRANCH updated. 9ecbe48e7226f9fe9b8b641d6fe7b3fddcd4bc1e

Mitch Jackson mitch at freeside.biz
Sat Oct 27 20:50:53 PDT 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  9ecbe48e7226f9fe9b8b641d6fe7b3fddcd4bc1e (commit)
      from  8eac87da359ab1ff577c2118566f3976952dd1c3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ecbe48e7226f9fe9b8b641d6fe7b3fddcd4bc1e
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sat Oct 27 23:42:55 2018 -0400

    RT# 38217 Fix substitutions for System Log email template

diff --git a/FS/FS/log.pm b/FS/FS/log.pm
index 88b82217f..875e1ac01 100644
--- a/FS/FS/log.pm
+++ b/FS/FS/log.pm
@@ -4,6 +4,7 @@ use strict;
 use base qw( FS::Record );
 use FS::Record qw( qsearch qsearchs dbdef );
 use FS::UID qw( dbh driver_name );
+use FS::Log;
 use FS::log_context;
 use FS::log_email;
 use FS::upgrade_journal;
@@ -82,6 +83,7 @@ sub insert {
   my $self = shift;
   my $error = $self->SUPER::insert;
   return $error if $error;
+
   my $contexts = {};       # for quick checks when sending emails
   my $context_height = @_; # also for email check
   foreach ( @_ ) { # ordered from least to most specific
@@ -93,6 +95,7 @@ sub insert {
     return $error if $error;
     $contexts->{$_} = $context_height--;
   }
+
   foreach my $log_email (
     qsearch('log_email',
       {
@@ -113,11 +116,11 @@ sub insert {
       next;
     }
     my $emailerror = $msg_template->send(
-      'msgtype'       => 'admin',
-      'to'            => $log_email->to_addr,
+      'msgtype' => 'admin',
+      'to'      => $log_email->to_addr,
       'substitutions' => {
-        'loglevel'   => $FS::Log::LEVELS{$self->level}, # which has hopefully been loaded...
-        'logcontext' => $log_email->context, # use the one that triggered the email
+        'loglevel'   => $FS::Log::LEVELS{$self->level} || 'unknown',
+        'logcontext' => join(', ', keys( %$contexts )) || 'unknown',
         'logmessage' => $self->message,
       },
     );

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

Summary of changes:
 FS/FS/log.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list