Did you restart RT after making the change? Unless you're in development mode, it won't pick up the changes. You probably need to flush your mason cache as well, just to be safe.<br><br><div class="gmail_quote">On Fri, Oct 26, 2012 at 9:40 AM, Red Pantyhose <span dir="ltr"><<a href="mailto:redpantyhose@yahoo.com" target="_blank">redpantyhose@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:arial,helvetica,sans-serif">Dear Christian<br><br>Thank you I applied some changes and I get still an error:<br>
<br>Oct 26 13:56:15 rt RT: Scrip Prepare 14 died. - Can't locate object method "new" via package "RT::Action::OpenSystemCustomFields" at /usr/share/request-tracker4/lib/RT/ScripAction.pm line 175.#012#012Stack:#012 [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012 [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012 [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012 [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012 [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012 [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012 [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012
[/usr/share/request-tracker4/html/Ticket/Create.html:444]#012 [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012 [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012 [/usr/share/request-tracker4/html/autohandler:53] (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)<div class="im">
<br><br>What am I doing wrong ? <br><br></div>Do I really need a sub new() ???<br><br>Thanks sincerely,<br><br>Denis<br><br><br>#-----------------------------OpenSystemCustomFields---------------------#<br><br>package RT::Action::OpenSystemCustomFields;<br>
<br>use strict;<br>use warnings;<br>use base qw(RT::Action);<br>our $VERSION = '0.01';<br><br>sub Describe {<br> my $self = shift;<br> my $class = ref($self) || $self;<br> return "$class will retrive values from the OS database and create dynamic CustomFields.";<div class="im">
<br>}<br><br>sub Prepare
{<br> my $self = shift;<br></div> my $class = ref($self) || $self;<div class="im"><br> return 1;<br>}<br><br>sub Commit {<br> my $self = shift;<br></div> my $class = ref($self) || $self;<br> return 1;<br>}<br><br>
RT::Base->_ImportOverlays();<br><br># ;)<br>1;<br><div class="hm HOEnZb"><br><br><br> </div><div><div class="hm HOEnZb"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt"><div class="hm HOEnZb">
</div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div class="hm HOEnZb"> <div dir="ltr"> <font face="Arial"> <hr size="1"> <b><span style="font-weight:bold">From:</span></b> Christian Loos <<a href="mailto:cloos@netcologne.de" target="_blank">cloos@netcologne.de</a>><br>
<b><span style="font-weight:bold">To:</span></b> Red Pantyhose <<a href="mailto:redpantyhose@yahoo.com" target="_blank">redpantyhose@yahoo.com</a>> <br><b><span style="font-weight:bold">Cc:</span></b> "<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>" <<a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a>> <br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, October 26, 2012 3:17 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: Write a Custom Action in rt4 as a Module/package ERROR<br> </font> </div></div>
<div><div class="h5"> <br>
uncomment this line:<br>#use base qw(RT::Action);<br><br>Chris<br><br>Am 26.10.2012 15:02, schrieb Red Pantyhose:<br>> Dear rt-users<br>> <br>> I created the following ActionScrip Module below - the Module is<br>
> registered.<br>> <br>> But i get the following Error:<br>> <br>> Oct 26 14:42:49 rt RT: Scrip Prepare 14 died. - Can't locate object<br>> method "new" via package "RT::Action::OpenSystemCustomFields" at<br>
> /usr/share/request-tracker4/lib/RT/ScripAction.pm line<br>> 175.#012#012Stack:#012 <br>> [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012 <br>> [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012 <br>
> [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012 <br>> [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012 <br>> [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012 <br>> [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012 <br>
>
[/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012 <br>> [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012 <br>> [/usr/share/request-tracker4/html/Ticket/Create.html:444]#012 <br>> [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012 <br>
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012 <br>> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012 <br>> [/usr/share/request-tracker4/html/autohandler:53]<br>> (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)<br>
> <br>> I'm using rt-4.0.5.<br>> <br>> What am I doing wrong ?<br>> <br>> Thanks Sincerely<br>> <br>> Denis<br>> <br>> <br>> #-------------------------------------OpenSystemCustomFields.init-------------------------------------------#<br>
> <br>> # To initialize the OpenSystemCustomFields ActionScrip:<br>> # rt-setup-database-4 --action insert --datafile
OpenSystemCustomFields.init<br>> <br>> @ScripActions = (<br>> {<br>> Name => 'OpenSystemCustomFields',<br>> Description => 'Create CustomFields from data retrieved out of the<br>
> OpenSystem DB',<br>> ExecModule => 'OpenSystemCustomFields',<br>> Argument => ''<br>> },<br>> );<br>> <br>> <br>> <br>> <br>> #-------------------------------------OpenSystemCustomFields.pm-------------------------------------------#<br>
> use strict;<br>> use warnings;<br>> <br>> package RT::Action::OpenSystemCustomFields;<br>> <br>> #use base qw(RT::Action);<br>> <br>> #use base qw(RT::Action::Generic);<br>> <br>> sub Prepare {<br>
> my $self = shift;<br>> return 1;<br>> }<br>> <br>> sub Commit {<br>> my $self = shift;<br>> return 1;<br>>
}<br>> <br>> # ;)<br>> 1;<br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> --------<br>> We're hiring! <a href="http://bestpractical.com/jobs" target="_blank">http://bestpractical.com/jobs</a><br>
> <br><br><br><br> </div></div></div> </div> </div></div></div><br>--------<br>
We're hiring! <a href="http://bestpractical.com/jobs" target="_blank">http://bestpractical.com/jobs</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="http://www.linkedin.com/in/paultomblin">http://www.linkedin.com/in/paultomblin</a><br><a href="http://careers.stackoverflow.com/ptomblin">http://careers.stackoverflow.com/ptomblin</a><br>
<br>