[rt-users] Abusing RT::Attachment::SetContent doesn't work

Jesse Vincent jesse at bestpractical.com
Mon Aug 21 14:19:54 EDT 2006




On Mon, Aug 21, 2006 at 02:13:19PM -0400, Timothy Smith wrote:
> 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, },
  };
}
# }}}


> 
> Thanks,
> Tim Smith
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
> 

-- 



More information about the rt-users mailing list