[Bps-public-commit] rt-extension-jsgantt branch, fix-error-with-no-results, created. 1.03-2-g0b5fc7e

Dustin Graves dustin at bestpractical.com
Mon Mar 28 17:24:13 EDT 2016


The branch, fix-error-with-no-results has been created
        at  0b5fc7e92c3dab78825c97d236afe7e7e02a7a3a (commit)

- Log -----------------------------------------------------------------
commit 0b5fc7e92c3dab78825c97d236afe7e7e02a7a3a
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Mon Mar 28 21:15:01 2016 +0000

    fix error on chart page when no tickets are found

diff --git a/html/Search/JSGantt.html b/html/Search/JSGantt.html
index 169a4b2..ac8a0a9 100644
--- a/html/Search/JSGantt.html
+++ b/html/Search/JSGantt.html
@@ -133,7 +133,7 @@ elsif ($Query) {
     else {
         $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order );
     }
-    @Tickets = @{ $Tickets->ItemsArrayRef };
+    @Tickets = @{ $Tickets->ItemsArrayRef || [] };
 }
 
 my ( $ids, $info ) = RT::Extension::JSGantt->TicketsInfo(
diff --git a/lib/RT/Extension/JSGantt.pm b/lib/RT/Extension/JSGantt.pm
index 7dd2d76..08c69de 100644
--- a/lib/RT/Extension/JSGantt.pm
+++ b/lib/RT/Extension/JSGantt.pm
@@ -215,7 +215,7 @@ sub TicketsInfo {
     if ( $options{ColorSchemeByOwner} ) {
         my @owner_names = uniq map { $_->OwnerObj->Name } @{ $args{Tickets} };
         @color_map{@owner_names} =
-          (@colors) x ( int @colors / @owner_names + 1 );
+          (@colors) x ( ( @owner_names ? int @colors / @owner_names : 0 ) + 1 );
         if (   ref $options{ColorSchemeByOwner}
             && ref $options{ColorSchemeByOwner} eq 'HASH' )
         {

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


More information about the Bps-public-commit mailing list