Approvals not working with 3.4rc6

Hello List,

I’m currently implenting Approvals and following the instructions at the
Wiki and mailinglist I’m having a problem which I think is really a bug
in RT.
Configuration:
RT3.4rc6, RTFM 2.04, Oracle9i, perl 5.8.6, fastcgi apache 1.3.31

Like a lot of people I couldn’t get approvals to work and after adding a
couple of debug statements to CreateTickets.pm I found an error in de
logfiles which pointed me to the fact that my template was wrong. I had
forgotten to start with an empty line.
After that it still didn’t work and the logs show the following:
[Thu Feb 3 13:08:44 2005] [debug]: In Parse (/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:760)
[Thu Feb 3 13:08:44 2005] [debug]: Content:
===Create-Ticket: codereview
Depended-On-By: {$Tickets{‘TOP’}->Id}
Type: approval
Queue: ___Approvals
Content: Someone has created a ticket. you should review and approve it,
ENDOFCONTENT

(/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:768)

Now I didn’t spot it right away but after adding a bit more debugging I
found something interesting, look closely at this:
[Thu Feb 3 13:42:18 2005] [debug]: T-A ===T-A (/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:770)

This is produced by the following lines I added to CreateTicket.pm
$t=substr( $args{‘Content’}, 0, 3 );
$RT::Logger->debug("$t ===" . $t);
I know, my perl sucks but it gave me the clue I needed and I don’t
understand why not more people are having problems because the
substr(…0,3) takes the first 3 characters from the template but ignores
the fact that the very first line is either empty or contains a MIME
object (header) which is the true for my case in the latter example. The
first piece of log is without RT-Attach-Message:Yes.

So if I use a template without a MIME header and thus starts with an
empty line and I change the substr(…,0,3) to substr(…,1,3) then RT
starts creating approval tickets.

Anyone knows whats going on? This is a plain rt3.4rc6 install (test). I
looked and in my 3.2.1 (old) and 3.2.2 (current production) installs the
code is identical.

Joop

Joop van de Wege JoopvandeWege@mococo.nl

At Thursday 2/3/2005 08:38 AM, Joop van de Wege wrote:

Hello List,

I’m currently implenting Approvals and following the instructions at the
Wiki and mailinglist I’m having a problem which I think is really a bug
in RT.
Configuration:
RT3.4rc6, RTFM 2.04, Oracle9i, perl 5.8.6, fastcgi apache 1.3.31

Like a lot of people I couldn’t get approvals to work and after adding a
couple of debug statements to CreateTickets.pm I found an error in de
logfiles which pointed me to the fact that my template was wrong. I had
forgotten to start with an empty line.
After that it still didn’t work and the logs show the following:
[Thu Feb 3 13:08:44 2005] [debug]: In Parse
(/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:760)
[Thu Feb 3 13:08:44 2005] [debug]: Content:
===Create-Ticket: codereview
Subject: Code review for {$Tickets{‘TOP’}->Subject}
Depended-On-By: {$Tickets{‘TOP’}->Id}
Type: approval
Queue: ___Approvals
Content: Someone has created a ticket. you should review and approve it,
ENDOFCONTENT

(/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:768)

Now I didn’t spot it right away but after adding a bit more debugging I
found something interesting, look closely at this:
[Thu Feb 3 13:42:18 2005] [debug]: T-A ===T-A
(/opt/rt_test/rt3.4rc6/local/lib/RT/Action/CreateTickets.pm:770)

This is produced by the following lines I added to CreateTicket.pm
$t=substr( $args{‘Content’}, 0, 3 );
$RT::Logger->debug("$t ===" . $t);
I know, my perl sucks but it gave me the clue I needed and I don’t
understand why not more people are having problems because the
substr(…0,3) takes the first 3 characters from the template but ignores
the fact that the very first line is either empty or contains a MIME
object (header) which is the true for my case in the latter example. The
first piece of log is without RT-Attach-Message:Yes.

So if I use a template without a MIME header and thus starts with an
empty line and I change the substr(…,0,3) to substr(…,1,3) then RT
starts creating approval tickets.

Anyone knows whats going on? This is a plain rt3.4rc6 install (test). I
looked and in my 3.2.1 (old) and 3.2.2 (current production) installs the
code is identical.

I don’t think you should have the blank line at the top of the template -
the first line should start with ‘===’. Then substr(…,0,3) will match
’===’. I’m guessing that with the blank line, $args{‘Content’} starts with
"\n===", so substr(…,0,3) would give “\n==” and substr(…,1,3) would give
"===".

Steve