Problem mailing to merged ticket

I’m wondering if anyone has seen this yet, or if there’s a workaround.

Using RT 1.0.6, if I use the mail interface to reply to a ticket that has
been merged with another, the mail generated has no text in it other than
the standard boilerplate/header at the bottom. The information is
appeanded to the correct (merged) ticket however.

I’m poking around in the source now to see if I can find a fix, but figured
I’d ask others before digging too deep. I suspect the problem is in
add_correspondence and has something to do with how the transaction number
is managed, but I need to look further.
Thanks,
-Matt

Matthew D. Stock writes:

Using RT 1.0.6, if I use the mail interface to reply to a ticket that has
been merged with another, the mail generated has no text in it other than
the standard boilerplate/header at the bottom. The information is
appeanded to the correct (merged) ticket however.

I think I found the problem… In transaction_in, is does a query to pull
up the transaction to mail. Then it called parse_transation_row, which
stores the results in a hash for the effective serial number. Since
everything else is using the now-merged serial number to key on, when the
data is read by template_replace_tokens, nothing is returned.

I’m going to try to compose a patch soon. I think I need to take a look at
how the web stuff is displayed when looking at the “effective” ticket and
make sure that doesn’t have the opposite problem.
-Matt

Matthew D. Stock writes:

I’m going to try to compose a patch soon. I think I need to take a look at
how the web stuff is displayed when looking at the “effective” ticket and
make sure that doesn’t have the opposite problem.

Here’s my patch to the merge problem:

— lib/rt/database.pm.orig Thu Jan 18 22:41:38 2001
+++ lib/rt/database.pm Thu Jan 18 23:00:32 2001
@@ -198,7 +198,7 @@
$effective_sn=&normalize_sn($in_serial_num);
$sth = $dbh->Query(“SELECT id, actor, type, trans_data, trans_date, serial_num, effective_sn from transactions WHERE effective_sn = $effective_sn ORDER BY id”) or warn “Query had some problem: $Msql::db_errstr\n”;
while (@row=$sth->FetchRow) {

  • &parse_transaction_row($counter, $in_current_user, @row);
  • &parse_transaction_row($counter, $in_current_user, $row[6], @row);
    $counter++;
    }
    return ($counter);
    @@ -212,15 +212,14 @@
    $sth = $dbh->Query($query_string) or return( “Query had some problem: $Mysql::db_errstr\nThe query was $query_string”);

    while (@row=$sth->FetchRow) {

  • &parse_transaction_row($trans, $in_current_user, @row);
  • &parse_transaction_row($trans, $in_current_user, $row[5], @row);
    }
    return ($trans);
    }

sub parse_transaction_row {

  • my ($in_id, $in_current_user, @row) = @_;
  • my ($in_id, $in_current_user, $serial_num, @row) = @_;
    my ($success,$content,$wday, $mon, $mday, $hour, $min, $sec, $TZ, $year);
  • $serial_num=$row[6];

    $rt::req[$serial_num]{‘trans’}[$in_id]{‘id’} = $row[0];
    $rt::req[$serial_num]{‘trans’}[$in_id]{‘serial_num’} = $row[5];