[rt-users] html "transaction appears to have no content", revisited
Nadeem Shahbaz
nadeem.shahbaz at prog.awpdc.com
Thu Dec 15 07:39:51 EST 2005
Well i also face same problem in RT 3.4.1, even it has text/plain part
in message. I looked code of ContentObj method in Transaction_Overlay.pm
According to code it just test first attachment in attachment list. And
don't test rest attachments. I have many transactions those have both
text/plain and text/html part and i get 'no content' stuff in email
notification.
is this fixed in later versions or still it is same ?
Nadeem.
[Code=RT/Transaction_Overlay.pm/ContentObj]
sub ContentObj {
my $self = shift;
# If we don\'t have any content, return undef now.
unless ( $self->Attachments->First ) {
return (undef);
}
# Get the set of toplevel attachments to this transaction.
my $Attachment = $self->Attachments->First();
# If it's a message or a plain part, just return the
# body.
if ( $Attachment->ContentType() =~ '^(text/plain$|message/)' ) {
return ($Attachment);
}
# If it's a multipart object, first try returning the first
# text/plain part.
elsif ( $Attachment->ContentType() =~ '^multipart/' ) {
my $plain_parts = $Attachment->Children();
$plain_parts->ContentType( VALUE => 'text/plain' );
# If we actully found a part, return its content
if ( $plain_parts->First && $plain_parts->First->Content ne '' ) {
return ( $plain_parts->First );
}
# If that fails, return the first text/plain or message/ part
# which has some content.
else {
my $all_parts = $Attachment->Children();
while ( my $part = $all_parts->Next ) {
if (( $part->ContentType() =~ '^(text/plain$|message/)'
) && $part->Content() ) {
return ($part);
}
}
}
}
[/CODE]
More information about the rt-users
mailing list