[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.9-43-g21e5e32

Alex Vandiver alexmv at bestpractical.com
Tue Dec 2 13:07:10 EST 2014


The branch, 4.2-trunk has been updated
       via  21e5e32c6b06c10e13494b45f929fda9b1ae8c44 (commit)
       via  0e0c1a80c020fdaba30cc70d668501b2a29c32e9 (commit)
       via  ad124cd523f1971e62751c738f759e67520c27f1 (commit)
      from  9bce2d2dcfd2a8864b6293906316f550c07260d4 (commit)

Summary of changes:
 lib/RT/Report/Tickets.pm       | 2 +-
 lib/RT/Report/Tickets/Entry.pm | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit ad124cd523f1971e62751c738f759e67520c27f1
Author: Christian Loos <cloos at netcologne.de>
Date:   Thu Nov 27 16:14:45 2014 +0100

    add check for empty raw value
    
    Previously grouping by dates results in empty labels for tickets without a date value.
    
    This fixes the following warnings:
    Use of uninitialized value in join or string at /opt/rtgit/share/html/Search/Chart line 274
    Use of uninitialized value in join or string at /opt/rtgit/share/html/Search/Chart line 302

diff --git a/lib/RT/Report/Tickets/Entry.pm b/lib/RT/Report/Tickets/Entry.pm
index 5f90e31..996c10d 100644
--- a/lib/RT/Report/Tickets/Entry.pm
+++ b/lib/RT/Report/Tickets/Entry.pm
@@ -71,7 +71,9 @@ sub LabelValue {
     my $raw = $self->RawValue( $name, @_ );
 
     if ( my $code = $self->Report->LabelValueCode( $name ) ) {
-        return $code->( $self, %{ $self->Report->ColumnInfo( $name ) }, VALUE => $raw );
+        $raw = $code->( $self, %{ $self->Report->ColumnInfo( $name ) }, VALUE => $raw );
+        return $self->loc('(no value)') unless defined $raw && length $raw;
+        return $raw;
     }
 
     unless ( ref $raw ) {

commit 0e0c1a80c020fdaba30cc70d668501b2a29c32e9
Author: Christian Loos <cloos at netcologne.de>
Date:   Thu Nov 27 16:19:23 2014 +0100

    fix sorting empty date values
    
    Date values can be empty so we have to account this while sorting.
    This fixes "Use of uninitialized value in string comparison (cmp)" warnings.

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index 047508a..a44512e 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -705,7 +705,7 @@ sub SortEntries {
             $method = 'LabelValue';
         }
         elsif ( $order eq 'raw' ) {
-            push @SORT_OPS, sub { $_[0][$idx] cmp $_[1][$idx] };
+            push @SORT_OPS, sub { ($_[0][$idx]//'') cmp ($_[1][$idx]//'') };
             $method = 'RawValue';
         }
         elsif ( $order eq 'numeric raw' ) {

commit 21e5e32c6b06c10e13494b45f929fda9b1ae8c44
Merge: 9bce2d2 0e0c1a8
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Dec 2 12:31:04 2014 -0500

    Merge branch '4.2/chart-group-by-dates-empty-values' into 4.2-trunk


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


More information about the rt-commit mailing list