Due date bug in /Ticket/Display.html for rt-2-0-8

RT version: 2.0.8 through 2.0.8_02

/Ticket/Display.html is misbehaving with regards to setting the Due date
when creating a new ticket using data from /Ticket/Create.html.

When I create a ticket with:

No default due date (ie, I leave the Due date blank)

or

Set a specific due date (11/30/2001)

Display.html appears to blindly override and use the same time as the
creation date.

Here’s a small diff of what I did to fix it. Hope you can take unified
diffs.

— /opt/rt2/WebRT/html/Ticket/Display.html Tue Nov 6 12:54:45 2001
+++ Display.html Tue Nov 6 13:09:07 2001
@@ -47,7 +47,13 @@
}

 my $due = new RT::Date($session{'CurrentUser'});
  • $due->Set(value => $ARGS{‘Due’});
  • if (defined $ARGS{‘Due’} and $ARGS{‘Due’} ne “”) {
  •    $due->Set(value => $ARGS{'Due'});
    
  • } elsif (defined ($Queue->DefaultDueIn)) {
  •    $due->SetToNow;
    
  •    $due->AddDays($Queue->DefaultDueIn);
    
  • }
    my $starts = new RT::Date($session{‘CurrentUser’});
    $starts->Set(value => $ARGS{‘Starts’});

As always, YMMV. This appears to work for me.

Travis
Travis Campbell - Unix Systems Administrator = travis@beast.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@beast.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.

So you know, there’s already a fix in CVS for 2.0.9 for this:

$due->Set(Format => 'unknown', Value => $ARGS{'Due'});On Tue, Nov 06, 2001 at 01:12:23PM -0600, Travis Campbell wrote:

RT version: 2.0.8 through 2.0.8_02

/Ticket/Display.html is misbehaving with regards to setting the Due date
when creating a new ticket using data from /Ticket/Create.html.

When I create a ticket with:

No default due date (ie, I leave the Due date blank)

or

Set a specific due date (11/30/2001)

Display.html appears to blindly override and use the same time as the
creation date.

Here’s a small diff of what I did to fix it. Hope you can take unified
diffs.

— /opt/rt2/WebRT/html/Ticket/Display.html Tue Nov 6 12:54:45 2001
+++ Display.html Tue Nov 6 13:09:07 2001
@@ -47,7 +47,13 @@
}

 my $due = new RT::Date($session{'CurrentUser'});
  • $due->Set(value => $ARGS{‘Due’});
  • if (defined $ARGS{‘Due’} and $ARGS{‘Due’} ne “”) {
  •    $due->Set(value => $ARGS{'Due'});
    
  • } elsif (defined ($Queue->DefaultDueIn)) {
  •    $due->SetToNow;
    
  •    $due->AddDays($Queue->DefaultDueIn);
    
  • }
  • my $starts = new RT::Date($session{‘CurrentUser’});
    $starts->Set(value => $ARGS{‘Starts’});

As always, YMMV. This appears to work for me.

Travis

Travis Campbell - Unix Systems Administrator = travis@beast.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@beast.amd.com

  "Does anything work as expected?"  Yes.  An axe through the CPU.

rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

So you know, there’s already a fix in CVS for 2.0.9 for this:

$due->Set(Format => 'unknown', Value => $ARGS{'Due'});

Ahha!

I did some looking but didn’t see anything obvious. I’ll look at using
this instead.

Thanks!

Travis
Travis Campbell - Unix Systems Administrator = travis@beast.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@beast.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.