[Rt-commit] rt branch, 5.0/dont-die-on-invalid-display-column-in-search-results, created. rt-5.0.0-222-g721424a727

Dianne Skoll dianne at bestpractical.com
Tue Jan 12 08:46:10 EST 2021


The branch, 5.0/dont-die-on-invalid-display-column-in-search-results has been created
        at  721424a727bac34439c85d4b65a970677d384209 (commit)

- Log -----------------------------------------------------------------
commit 721424a727bac34439c85d4b65a970677d384209
Author: Dianne Skoll <dianne at bestpractical.com>
Date:   Tue Jan 12 08:40:56 2021 -0500

    If an invalid display colunm is specified, display "Invalid column" rather than dying.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index ab982782f7..4a5ed14d1f 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -3987,7 +3987,11 @@ sub ProcessColumnMapValue {
 
     if ( ref $value ) {
         if ( UNIVERSAL::isa( $value, 'CODE' ) ) {
-            my @tmp = $value->( @{ $args{'Arguments'} } );
+            my @tmp;
+            eval { @tmp = $value->( @{ $args{'Arguments'} } ); };
+            if ($@) {
+                return ProcessColumnMapValue( loc("Invalid column") );
+            }
             return ProcessColumnMapValue( ( @tmp > 1 ? \@tmp : $tmp[0] ), %args );
         } elsif ( UNIVERSAL::isa( $value, 'ARRAY' ) ) {
             return join '', map ProcessColumnMapValue( $_, %args ), @$value;

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


More information about the rt-commit mailing list