[rt-users] Problem with \@Actions array and custom callback

Ruslan Zakirov ruz at bestpractical.com
Mon Mar 26 05:49:27 EDT 2012


On Mon, Mar 26, 2012 at 03:07, Mikko Lehto <mslehto at iki.fi> wrote:
> Hello everybody.
>
> I am not able to see messages in web UI that are pushed from my callback.
> I am running RT 4.0.1 from Ubuntu 11.10 package.
>
> Below is minimal callback routine which demonstrates the problem
> (/usr/local/share/request-tracker4/html/Callbacks/Test/Ticket/Display.html/ProcessArguments):
> ---
> % foreach my $action (@Actions) {
> % $RT::Logger->info("ProcessArguments foreach: $action");
> % }
>
> <%INIT>
> $RT::Logger->info("ProcessArguments INIT");
> my $msg="result OK";
> push(@Actions, $msg);
> </%INIT>
>
> <%ARGS>
>  $Ticket => undef
>  %ARGSRef => undef
>  @Actions => undef
> </%ARGS>


You should defined @Actions argument as $Actions => []. In your code
Mason binds array ref to array where it looses to connection the
reference, so you just work with a copy. To access array via reference
you the following constructions:

push @$Actions,...
$Actions->[1] ...


> ---
>
> With the above callback I get nothing in web UI notification area, allthough
> syslog shows callback has been visited:
> ---
> [Sun Mar 25 21:45:56 2012] [info]: ProcessArguments INIT
> (/usr/local/share/request-tracker4/html/Callbacks/Test/Ticket/Display.html/ProcessArguments:6)
> [Sun Mar 25 21:45:56 2012] [info]: ProcessArguments foreach: result OK
> (/usr/local/share/request-tracker4/html/Callbacks/Test/Ticket/Display.html/ProcessArguments:2)
> ---
>
> Standard RT notifications work as expected (add reminder or update
> 'Told' in Display.html).
> I checked list archives and masonbook.comน but can not find
> anything anymore to help troubleshoot forward.
>
> Any pointers what I might be doing wrong?
>
> [1]
> http://www.masonbook.com/book/chapter-2.mhtml#TOC-ANCHOR-14
>
> --
> Mikko Lehto



-- 
Best regards, Ruslan.



More information about the rt-users mailing list