Bug / docu error in lib/RT/Transaction_Overlay.pm

Minor, but anyway:

The POD says:

=head2 Content PARAMHASH

If this transaction has attached mime objects, returns the body of the
first textual part (as defined in RT::I18N::IsTextualContentType).
Otherwise, returns undef.

but the code does:

# If all else fails, return a message that we couldn't find any
# content
else {
    $content = $self->loc('This transaction appears to have no content');
}

and thus never returns undef.

/ol
-=- Otmar Lendl – ol@bofh.priv.at -=-

thanks for pointing, want to provide a patch? :)On Fri, Aug 22, 2008 at 1:34 PM, Otmar Lendl ol@bofh.priv.at wrote:

Minor, but anyway:

The POD says:

=head2 Content PARAMHASH

If this transaction has attached mime objects, returns the body of the
first textual part (as defined in RT::I18N::IsTextualContentType).
Otherwise, returns undef.

but the code does:

If all else fails, return a message that we couldn’t find any

content

else {
$content = $self->loc(‘This transaction appears to have no content’);
}

and thus never returns undef.

/ol

-=- Otmar Lendl – ol@bofh.priv.at -=-


List info: The rt-devel Archives

Best regards, Ruslan.

thanks for pointing, want to provide a patch? :slight_smile:

As I have no idea what code actually depends on $t->Content never to
return undef, I’d go for channging the documentation. e.g.

If this transaction has attached mime objects, returns the body of the
first textual part (as defined in RT::I18N::IsTextualContentType).

  • Otherwise, returns undef.
  • Otherwise, return a string stating that there is no content associated
  • with this transaction.

/ol
-=- Otmar Lendl – ol@bofh.priv.at -=-