rt 4.0.23
[freeside.git] / rt / share / html / Elements / ColumnMap
index 7b127e9..3ae10ea 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -111,19 +111,20 @@ my $COLUMN_MAP = {
 
             # Display custom field contents, separated by newlines.
             # For Image custom fields we also show a thumbnail here.
-
             my $values = $cf->ValuesForObject( $_[0] );
             return if $values->Count == 0;
+
             my @values;
             # it is guaranteed to be the same type for all fields, right?
             my $v = $values->First;
+            my $cftype = $v->CustomFieldObj->Type;
 
             do {
-                if ($v->Type eq 'Image') {
+                if ($cftype eq 'Image') {
                     push @values, 
                         \($m->scomp( '/Elements/ShowCustomFieldImage',
                                       Object => $v ));
-                } elsif ( $v->Type eq 'Date' or $v->Type eq 'DateTime' ) {
+                } elsif ( $cftype eq 'Date' or $cftype eq 'DateTime' ) {
                     # then actually return the date object;
                     # ProcessColumnMapValue will stringify it
                     my $DateObj = RT::Date->new( $session{'CurrentUser'} );
@@ -159,7 +160,7 @@ my $COLUMN_MAP = {
             my $arg = $DECODED_ARGS->{ $name };
             my $checked = '';
             if ( $arg && ref $arg ) {
-                $checked = 'checked="checked"' if grep $_ == $id, @$arg;
+                $checked = 'checked="checked"' if grep $_ == $id, grep { defined and length } @$arg;
             }
             elsif ( $arg ) {
                 $checked = 'checked="checked"' if $arg == $id;