X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FTicketSystem.pm;h=3c972d0bd67a224903fdc7231f40dc3345572974;hp=fa54e0bbd8ecb6af6d2e87b27bf07f92938d346b;hb=2ea729e55651a288bbf3826c888f430806aab04c;hpb=a172aa2d549f2c62978fa1f6b6851a68ae0f2a4e diff --git a/FS/FS/TicketSystem.pm b/FS/FS/TicketSystem.pm index fa54e0bbd..3c972d0bd 100644 --- a/FS/FS/TicketSystem.pm +++ b/FS/FS/TicketSystem.pm @@ -357,6 +357,16 @@ sub _upgrade_data { warn "Removed $rows dangling ticket-$table links\n" if $rows > 0; } + # Fix ticket transactions on the Time* fields where the NewValue (or + # OldValue, though this is not known to happen) is an empty string + foreach (qw(newvalue oldvalue)) { + my $rows = $dbh->do( + "UPDATE transactions SET $_ = '0' WHERE objecttype='RT::Ticket' AND ". + "field IN ('TimeWorked', 'TimeEstimated', 'TimeLeft') AND $_ = ''" + ) or die $dbh->errstr; + warn "Fixed $rows transactions with empty time values\n" if $rows > 0; + } + return; }