[Rt-commit] rt branch, 4.0/skip-reminders-on-ticket-clone, updated. rt-4.0.3-42-g4d3b0f9
Jason May
jasonmay at bestpractical.com
Thu Dec 1 16:47:06 EST 2011
The branch, 4.0/skip-reminders-on-ticket-clone has been updated
via 4d3b0f9401beb25471da7f36ac4e0d3d9ac472ee (commit)
from 96351e7583bae1353b632c2921ebe8752c1c3df9 (commit)
Summary of changes:
share/html/Ticket/Create.html | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 4d3b0f9401beb25471da7f36ac4e0d3d9ac472ee
Author: Jason May <jasonmay at bestpractical.com>
Date: Thu Dec 1 16:37:51 2011 -0500
Be more defensive when checking for ticket reminders
If the ticket refers to, say, a link instead of a ticket, LocalBase will be
undefined, throwing a fatal error without this change.
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 6d00955..919514b 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -306,11 +306,13 @@ if ($CloneTicket) {
my $refers_by = $CloneTicketObj->ReferredToBy;
while ( my $refer_by = $refers_by->Next ) {
- my $base_ticket = RT::Ticket->new($session{CurrentUser});
- my ($ok) = $base_ticket->Load($refer_by->LocalBase);
- next if !$ok || $base_ticket->Type eq 'reminder';
+ my $uri = $refer_by->BaseURI;
+ next if $uri->IsLocal and
+ $uri->Object and
+ $uri->Object->isa('RT::Ticket') and
+ $uri->Object->Type eq 'reminder';
- push @refers_by, $refer_by->LocalBase;
+ push @refers_by, $uri->Object->Id;
}
$clone->{'RefersTo-new'} = join ' ', @refers_by;
if (0) { # Temporarily disabled
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list