Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Problem with \@Actions array and custom callback

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


mslehto at iki

Mar 25, 2012, 4:07 PM

Post #1 of 2 (379 views)
Permalink
Problem with \@Actions array and custom callback

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>
---

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


ruz at bestpractical

Mar 26, 2012, 2:49 AM

Post #2 of 2 (368 views)
Permalink
Re: Problem with \@Actions array and custom callback [In reply to]

On Mon, Mar 26, 2012 at 03:07, Mikko Lehto <mslehto [at] iki> 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.

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.