[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0-94-g4c3f65e4be

? sunnavy sunnavy at bestpractical.com
Thu Nov 5 17:01:22 EST 2020


The branch, 5.0-trunk has been updated
       via  4c3f65e4bee5b8473e0464eafeed590771f0243e (commit)
      from  8b2e367023c632dc7e4aeaef2ec2543eb54967c3 (commit)

Summary of changes:
 lib/RT/Record.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 4c3f65e4bee5b8473e0464eafeed590771f0243e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Nov 6 05:42:25 2020 +0800

    Confirm the queue default value in %ServiceAgreements is a hash before using it so
    
    It could be a scalar(service level). This is to get rid of errors like:
    
        Can't use string ("default") as a HASH ref while "strict refs" in lib/RT/Record.pm line 2590
    
    Fixes: I#36674

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 39bce16b22..e26e54d339 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -2587,7 +2587,9 @@ sub CustomDateRange {
         # Prefer the schedule/timezone specified in %ServiceAgreements for current object
         if ( $self->isa('RT::Ticket') && !$self->QueueObj->SLADisabled && $self->SLA ) {
             if ( my $config = RT->Config->Get('ServiceAgreements') ) {
-                $timezone = $config->{QueueDefault}{ $self->QueueObj->Name }{Timezone};
+                if ( ref( $config->{QueueDefault}{ $self->QueueObj->Name } ) eq 'HASH' ) {
+                    $timezone = $config->{QueueDefault}{ $self->QueueObj->Name }{Timezone};
+                }
 
                 # Each SLA could have its own schedule and timezone
                 if ( my $agreement = $config->{Levels}{ $self->SLA } ) {

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


More information about the rt-commit mailing list