fix upgrade bug that was causing tickets to spontaneously resolve, #23309
authorMark Wells <mark@freeside.biz>
Sun, 18 Aug 2013 00:06:36 +0000 (17:06 -0700)
committerMark Wells <mark@freeside.biz>
Sun, 18 Aug 2013 00:06:36 +0000 (17:06 -0700)
FS/FS/TicketSystem.pm
rt/lib/RT/Interface/Web_Vendor.pm

index 3aeadb3..c1c69fa 100644 (file)
@@ -342,11 +342,6 @@ sub _upgrade_data {
     or die $dbh->errstr;
   $cve_2013_3373_sth->execute or die $cve_2013_3373_sth->errstr;
 
-  # fix null WillResolve fields to avoid spurious transactions the 
-  # first time they get updated
-  my $fix_null_sql = "UPDATE Tickets SET WillResolve = '1970-01-01 00:00:00' WHERE WillResolve IS NULL";
-  $dbh->do($fix_null_sql) or die $dbh->errstr;
-
   return;
 }
 
index 023dede..0c061e2 100644 (file)
@@ -264,10 +264,11 @@ sub ProcessTicketBasics {
       my $DateObj = RT::Date->new($session{'CurrentUser'});
       if ( $to_date ) {
           $DateObj->Set(Format => 'unknown', Value => $to_date);
-      } else {
+          $ARGSRef->{'WillResolve'} = $DateObj->ISO;
+      } elsif ( $TicketObj and $TicketObj->WillResolveObj->Unix > 0 ) {
           $DateObj->Set(Value => 0);
+          $ARGSRef->{'WillResolve'} = $DateObj->ISO;
       }
-      $ARGSRef->{'WillResolve'} = $DateObj->ISO;
     }
 
     if ( $ARGSRef->{'Queue'} and ( $ARGSRef->{'Queue'} !~ /^(\d+)$/ ) ) {