[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.1-440-gaa9732fc3c

Jim Brandt jbrandt at bestpractical.com
Fri Jun 11 13:24:35 EDT 2021


The branch, 5.0-trunk has been updated
       via  aa9732fc3c82f92a3d33782019ce63f3c6cd2891 (commit)
       via  1c51773c62a4f4a695d336938a1e70e5ce55e00f (commit)
      from  aceb564affe64c585262e8fc0e493e880419ee58 (commit)

Summary of changes:
 lib/RT/Interface/Web.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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

    Trap fatal errors when processing column map values
    
    Calling a missing method in search results died with a
    message like:
    
        RT::Transaction::LastUpdated Unimplemented in RT::Record
    
    Trap these errors to prevent the die and provide a placeholder
    value so the rest of the search can display.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index ab982782f7..05bde14688 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -3987,7 +3987,12 @@ sub ProcessColumnMapValue {
 
     if ( ref $value ) {
         if ( UNIVERSAL::isa( $value, 'CODE' ) ) {
-            my @tmp = $value->( @{ $args{'Arguments'} } );
+            my @tmp;
+            eval { @tmp = $value->( @{ $args{'Arguments'} } ); };
+            if ( $@ ) {
+                # Looks like the object $value doesn't have the requested method
+                return ProcessColumnMapValue( loc("Invalid column") );
+            }
             return ProcessColumnMapValue( ( @tmp > 1 ? \@tmp : $tmp[0] ), %args );
         } elsif ( UNIVERSAL::isa( $value, 'ARRAY' ) ) {
             return join '', map ProcessColumnMapValue( $_, %args ), @$value;

commit aa9732fc3c82f92a3d33782019ce63f3c6cd2891
Merge: aceb564aff 1c51773c62
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jun 11 13:24:23 2021 -0400

    Merge branch '5.0/dont-die-on-invalid-display-column-in-search-results' into 5.0-trunk


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


More information about the rt-commit mailing list