[rt-users] [bug] Message without text but with attachment(s) is not recodered
Boris Lytochkin
boris.lytochkin at e-port.ru
Sat Aug 18 20:47:54 EDT 2007
The reason is in share/html/Ticket/Display.html:
================
$ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'};
if ( $ARGS{'UpdateTimeWorked'} || (
defined $ARGS{'UpdateContent'}
&& $ARGS{'UpdateContent'} ne ''
&& $ARGS{'UpdateContent'} ne "-- \n"
. $session{'CurrentUser'}->UserObj->Signature ) )
{
$ARGS{UpdateAttachments} = $session{'Attachments'};
ProcessUpdateMessage(
ARGSRef => \%ARGS,
Actions => \@Actions,
TicketObj => $TicketObj,
);
delete $session{'Attachments'};
}
================
But should be
================
if ( $ARGS{'UpdateTimeWorked'} || (
defined $ARGS{'UpdateContent'}
&& $ARGS{'UpdateContent'} ne '' ) ||
scalar(keys(%{$session{'Attachments'}})) )
{
$ARGS{'UpdateContent'} = $ARGS{'UpdateContent'}."-- \n".$session{'CurrentUser'}->UserObj->Signature;
$ARGS{UpdateAttachments} = $session{'Attachments'};
ProcessUpdateMessage(
ARGSRef => \%ARGS,
Actions => \@Actions,
TicketObj => $TicketObj,
);
delete $session{'Attachments'};
}
================
Additionally, 'IncludeSignature => 0' must be set in MessageBox on Update.html page.
The same situation is with BulkUpdate form, it must be like this:
================
# Prepare for ticket updates
if ($ARGS{'UpdateContent'}) {
if ( $ARGS{'UpdateContent'} ne '' || scalar(keys(%{$session{'Attachments'}})) ){
$ARGS{'UpdateContent'} .= "\n-- \n".$session{'CurrentUser'}->UserObj->Signature;
$do_comment_reply = 1;
}
}
================
with 'IncludeSignature => 0' set in MessageBox.
'IncludeSignature => 0' should be used because of different wrapping
styles - make your signature be with looong lines without
hand-made wrapping (using \n) - RT will record your signature as text because
$ARGS{'UpdateContent'} ne "-- \n".$session{'CurrentUser'}->UserObj->Signature )
will be true because of broken '\n' sequence.
--
Boris Lytochkin
JSC e-port, Moscow
More information about the rt-users
mailing list