Skip to content

Commit

Permalink
Fix call to _EncodeLOB for ObjectCustomFieldValue records
Browse files Browse the repository at this point in the history
ObjectCustomFieldValue records do not have a Filename so only pass that
to _EncodeLOB for Attachment records.
  • Loading branch information
bkembreeBPS committed Jul 5, 2024
1 parent 854434f commit 0b246c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/RT/Record.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,11 @@ sub BeforeWipeout {

# Internalize content so we can re-create objects easily from generated SQL
if ( my $external_content = $storage->Get($digest) ) {
my ( $encoding, $content ) = $self->_EncodeLOB( $external_content, $self->ContentType, $self->Filename );
# only RT::Attachment records have a Filename
my @encode_lob_args = ( $external_content, $self->ContentType );
push @encode_lob_args, $self->Filename
if $self->isa('RT::Attachment');
my ( $encoding, $content ) = $self->_EncodeLOB(@encode_lob_args);
my ( $ret, $msg ) = $self->__Set( Field => 'ContentEncoding', Value => $encoding );
if ( !$ret ) {
RT->Logger->error("Could not set ContentEncoding to $encoding: $msg");
Expand Down

0 comments on commit 0b246c2

Please sign in to comment.