Download Attachments results in Mason Error

Hi everybody,

I did not find any hints about that problem in the Mailing Lists or in
the Bugs Database: Whenever a user tries to download an attachment from
the web interface, RT generates a mason error like:

— cut here —

error in file: /usr/lib/perl5/5.6.0/Carp/Heavy.pm
line 79: Bizarre copy of HASH in aassign

context: …
75: # them according to the format variables defined earlier in
76: # this file and join them onto the $sub sub-routine string
77: if ($hargs) {
78: # we may trash some of the args so we take a copy
79: @a = @DB::args; # must get local copy of args
80: # don’t print any more than $MaxArgNums
81: if ($MaxArgNums and @a > $MaxArgNums) {
82: # cap the length of $#a and set the last element to ‘…’
83: $#a = $MaxArgNums;

component stack: /Ticket/Attachment/dhandler [standard]
/autohandler [standard]

code stack: /usr/lib/perl5/5.6.0/Carp/Heavy.pm:79

raw error:

error while executing /Ticket/Attachment/dhandler [standard]:
Bizarre copy of HASH in aassign at /usr/lib/perl5/5.6.0/Carp/Heavy.pm
line 79, line 184.

— cut here —

The URL of the attachment (Ticket No #481) is pointing to:
http://www.domain.de/rt2/Ticket/Attachment/2665/1383/sec.pl

It happend since installing 2-0-1 and now with 2-0-2test1, too.

Thanks for your help,

Julian

Hi,

I could fix the error in rt-2-0-2test1 by commenting 1 line (at —>) in
/opt/rt2/WebRT/html/Ticket/Attachment/dhandler:

— cut here —

<%perl>
my ($ticket, $trans,$attach, $filename);
my $arg = $m->dhandler_arg; # get rest of path
if ($arg =~ ‘^(\d+)/(\d+)’) {
$trans = $1;
$attach = $2;
}
else {
Abort(“Corrupted attachment URL.”);
}
my $AttachmentObj = new RT::Attachment($session{‘CurrentUser’});
$AttachmentObj->Load($attach) || Abort(“Attachment ‘$attach’ could
not be loaded”);

 unless ($AttachmentObj->id) {
    Abort("Bad attachment id. Couldn't find attachment

‘$attach’\n");
}
unless ($AttachmentObj->TransactionId() == $trans ) {
Abort(“Bad transaction number for attachment. $trans should
be”.$AttachmentObj->TransactionId() ."\n");

 }
 my $content_type = $AttachmentObj->ContentType || 'text/plain';

–> # SetContentType($content_type);
$m->out($AttachmentObj->Content);
$m->abort;
</%perl>

— cut here —

Julian