[rt-devel] simple custom Action gives Mason compiler error
a.smith at ldex.co.uk
a.smith at ldex.co.uk
Sat Mar 21 11:05:48 EDT 2015
Hi,
this is my first attempt at creating a custom action perl module, its
very simple all I want it to do is to change the queue of tickets so
that I can call it from rt-crontool.
The code is as follows:
use strict;
use warnings;
use RT::Queue;
use base qw(RT::Action);
package RT::Action::Test;
my $self;
sub Prepare {
my $self = shift;
return 1;
}
sub Commit {
my $self = shift;
my $argument = $self->Argument;
unless ( $argument ) {
$RT::Logger->error("Argument is mandatory for Test action");
return 0;
}
my ($status, $msg) = $self->TicketObj->SetQueue("$argument");
if ( not $status ) {
RT::Logger->error("Could not reassign queue: $msg");
}
return 1;
}
1;
And the error I get when I restart Apache is:
[15029] [Sat Mar 21 14:55:32 2015] [warning]: (in cleanup) Error
while loading /usr/local/sbin/rt-server: The 'compiler' parameter
("HTML::Mason::Compiler::ToObject=HASH(0x814eabdb0)") to
HTML::Mason::Interp->new() was not a 'HTML::Mason::Compiler' (it is a
HTML::Mason::Compiler::ToObject=HASH(0x814eabdb0))
(/usr/local/lib/perl5/site_perl/RT.pm:390)
And RT is unavailable until I remove the perl module file and restart
Apache again. Intrestingly if I copy the perl module to the Action
directory while RT is up the perl module works, that is I can call it
from rt-crontool and it moves the tickets as desired.
Software versions are:
OS: FreeBSD 10.1
RT: 4.2.10
Perl: 5.18.4
As mentioned I'm a noob, any help much appreciated,
thanks, Andy.
More information about the rt-devel
mailing list