Abusing RT::Attachment::SetContent doesn't work

I’m trying to permit users to modify the message content of an existing transaction.

$Transaction->Message->First->SetContent(…) returns (0, ‘Immutable field’). Variations on the theme, like $Transaction->ContentObj->SetContent(…) do the same.

I don’t understand why. It’s of type $RT::Attachment, and Attachment.pm says

    Content => 
            {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''}

in &_CoreAccessible so it looks like I should be able to change it. It’s not MySQL weirdness because I can manually update the contents and watch it show up on Display.html. What should I be doing? I’m using RT 3.6.1.

Thanks,
Tim Smith

I’m trying to permit users to modify the message content of an existing transaction.

$Transaction->Message->First->SetContent(…) returns (0, ‘Immutable field’). Variations on the theme, like $Transaction->ContentObj->SetContent(…) do the same.

I don’t understand why. It’s of type $RT::Attachment, and Attachment.pm says

    Content => 
            {read => 1, write => 1, sql_type => -4, length => 0,  is_blob => 1,  is_numeric => 0,  type => 'longtext', default => ''}

in &_CoreAccessible so it looks like I should be able to change it. It’s not MySQL weirdness because I can manually update the contents and watch it show up on Display.html. What should I be doing? I’m using RT 3.6.1.

Have a look at Attachment_Overlay.pm

{{{ sub _OverlayAccessible

sub _OverlayAccessible {
{
TransactionId => { ‘read’=>1, ‘public’=>1, ‘write’ => 0 },
MessageId => { ‘read’=>1, ‘write’ => 0 },
Parent => { ‘read’=>1, ‘write’ => 0 },
ContentType => { ‘read’=>1, ‘write’ => 0 },
Subject => { ‘read’=>1, ‘write’ => 0 },
Content => { ‘read’=>1, ‘write’ => 0 },
ContentEncoding => { ‘read’=>1, ‘write’ => 0 },
Headers => { ‘read’=>1, ‘write’ => 0 },
Filename => { ‘read’=>1, ‘write’ => 0 },
Creator => { ‘read’=>1, ‘auto’=>1, },
Created => { ‘read’=>1, ‘auto’=>1, },
};
}

}}}