Problem with Callback / NewTicketsAlert

Hello everybody,

I have a problem with callbacks, especially NewTicketsAlert.

I put the callback code as described in
http://requesttracker.wikia.com/wiki/NewTicketsAlert in my local
directory (Debian), which is
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT
and there the file is named BeforeTable.

After reloading /clearing the cache, an internal error is displayed on
the My RT page. The log says:

[Fri Apr 25 14:49:11 2014] [error]: Error during compilation of
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable:

Global symbol “$ticket” requires explicit package name at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 7.

Global symbol “$ticket” requires explicit package name at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 7.

Global symbol “$ticket” requires explicit package name at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 7.

syntax error at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 15, near “},”

Missing right curly or square bracket at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 19, at end of line
(/usr/share/request-tracker4/lib/RT/Interface/Web/Handler.pm:209)

Does anyone know how to handle that? I don’t see any syntax error I
could correct. Any help appreciated.

Regards, Patrick

I have a problem with callbacks, especially NewTicketsAlert.

It appears your problem is with the code in NewTicketsAlert, not with
callbacks in general.

Global symbol “$ticket” requires explicit package name at
/usr/local/share/request-tracker4/html/Callbacks/NewTicketsAlert/Elements/MyRT/BeforeTable
line 7.

My assumption is that you copied and pasted, leaving blank spaces at
the beginning of the line which makes it invalid mason code.

You can’t have

% my $ticket

you have to write

% my $ticket

-kevin

I have a problem with callbacks, especially NewTicketsAlert.

It appears your problem is with the code in NewTicketsAlert, not with
callbacks in general.

[…]

My assumption is that you copied and pasted, leaving blank spaces at
the beginning of the line which makes it invalid mason code.

Kevin, thank you. Indeed that was the error. Memorized for the future.

Regards, Patrick