[Rt-commit] rtir branch, 4.0.0/disabled-queue, created. 4.0.0rc2-1-gd60ae1f

Shawn Moore shawn at bestpractical.com
Wed Jul 13 16:04:09 EDT 2016


The branch, 4.0.0/disabled-queue has been created
        at  d60ae1fafc092f69fcde83e5ed588a9aeae294a5 (commit)

- Log -----------------------------------------------------------------
commit d60ae1fafc092f69fcde83e5ed588a9aeae294a5
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Jul 13 20:01:02 2016 +0000

    Avoid error when all queues of a type are disabled
    
        In particular when the Countermeasures queue is disabled,
        $cache{countermeasures} will be undef (because it's not returned in the
        RT::IR::Queues function), so using array dereference on undef throws an
        error. This manifests itself by throwing an error while displaying
        custom field value changes on /RTIR/Display.html.

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 502dde9..04980c4 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -710,9 +710,9 @@ sub CustomFields {
 
     my @list;
     if ( $type ) {
-        @list = (@{ $cache{'Global'} }, @{ $cache{$type} });
+        @list = (@{ $cache{'Global'} }, @{ $cache{$type} || [] });
     } else {
-        @list = (@{ $cache{'Global'} }, map { @$_ } @cache{values %TYPE});
+        @list = (@{ $cache{'Global'} }, map { @{ $_ || [] } } @cache{values %TYPE});
     }
 
     if ( my $field = $arg{'Field'} ) {

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


More information about the rt-commit mailing list