[freeside-commits] branch master updated. 681a340f6be4184b1472a8e1fa9cd5d074f6f325
Ivan
ivan at 420.am
Wed Feb 8 16:02:21 PST 2017
The branch, master has been updated
via 681a340f6be4184b1472a8e1fa9cd5d074f6f325 (commit)
from 6f51d54c8de43287007d1844595314cbed511f4c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 681a340f6be4184b1472a8e1fa9cd5d074f6f325
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Feb 8 16:02:18 2017 -0800
fix ticketing system error on bootstrap of new install
diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index 16a04f4..35917c3 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -19,17 +19,21 @@ my $UnrepliedTickets;
if ($enabled) {
my $class = 'RT::Search::UnrepliedTickets';
load_class($class);
- my $session = FS::TicketSystem->session;
- my $CurrentUser = $session->{CurrentUser};
- # if there are no tickets the current user could see, always hide it
- my $AnyTickets = RT::Tickets->new($CurrentUser);
- foreach my $status (qw(resolved rejected deleted)) {
- $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
- }
- $enabled = 0 if $AnyTickets->Count == 0;
+ my $session = eval { FS::TicketSystem->session; };
+ if ( $session ) {
+ my $CurrentUser = $session->{CurrentUser};
+ # if there are no tickets the current user could see, always hide it
+ my $AnyTickets = RT::Tickets->new($CurrentUser);
+ foreach my $status (qw(resolved rejected deleted)) {
+ $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
+ }
+ $enabled = 0 if $AnyTickets->Count == 0;
- $UnrepliedTickets = RT::Tickets->new($CurrentUser);
- my $search = $class->new(TicketsObj => $UnrepliedTickets);
- $search->Prepare;
+ $UnrepliedTickets = RT::Tickets->new($CurrentUser);
+ my $search = $class->new(TicketsObj => $UnrepliedTickets);
+ $search->Prepare;
+ } else {
+ $enabled = 0;
+ }
}
</%init>
-----------------------------------------------------------------------
Summary of changes:
httemplate/elements/notify-tickets.html | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
More information about the freeside-commits
mailing list