ArticleTemplates not running perl code

I’m trying to run {$Ticket->FirstCustomFieldValue (“Feed”)} to catch the e-mail body and include into my template, but the command just not run.

I’ve already had followed these steps: RT::Extension::ArticleTemplates - Turns Articles into dynamic templates - metacpan.org
And my version is 5.0.1

But the perl command still not works and i receive no errors on my log files.

Has anyone experienced the same problem?

Do you just see the Perl code rendered as text?

Exactly. It looks simple to resolv but i’ve already had spend some days on it and i got anywhere.
I’m upgrading from 4.4.4 and it works pretty fine in this version.

Did you apply the patch?

I installed the new version (5.0.1), so in my /opt i have rt4/ and rt5/.
I made a copy of the database from rt4 to rt5 and make a database-upgrade.

Everything looks ok in my 5.0.1 version, except by this part.
And this part works pretty fine on my 4.4.4 version.

Patch RT

This step is required only for RT versions 5.0.0 and 5.0.1. Apply the patch as follows:

patch -p1 -d /path/to/rt < patches/article-preformatted-ticket-object.patch

Did you do that step though?

Yes.

Patch RT
This step is required only for RT versions 5.0.0 and 5.0.1. Apply the patch as follows:

patch -p1 -d /path/to/rt < patches/article-preformatted-ticket-object.patch

Clear your mason cache

rm -rf /opt/rt5/var/mason_data/obj

Restart your webserver

The extension works for me with RT 5.0.1, extension version 1.03. Anything in the logs if you set them to debug? How are you testing?

I only received this message in /var/log/syslog

RT: [26563] Lifecycle blocks is missing in %Lifecycles config at /opt/rt5/sbin/…/lib/RT/Lifecycle.pm line 645.
RT: [26563] Lifecycle incident_reports is missing in %Lifecycles config at /opt/rt5/sbin/…/lib/RT/Lifecycle.pm line 645.
RT: [26563] Lifecycle incidents is missing in %Lifecycles config at /opt/rt5/sbin/…/lib/RT/Lifecycle.pm line 645.
RT: [26563] Lifecycle investigations is missing in %Lifecycles config at /opt/rt5/sbin/…/lib/RT/Lifecycle.pm line 645.
RT: [26563] Lifecycle blocks is missing in %Lifecycles config at /opt/rt5/sbin/…/lib/RT/Lifecycle.pm line 645.

But i don’t think that this is related to my problem because when i run a new article this message is not shown again.

Now i tried to run the patch again, and receives this message:

patch -p1 -d /opt/rt5/ < patches/article-preformatted-ticket-object.patch

patching file share/html/Articles/Elements/IncludeArticle
Reversed (or previously applied) patch detected! Assume -R? [n] -R
Apply anyway? [n] y
Hunk #1 FAILED at 78.
1 out of 1 hunk FAILED – saving rejects to file share/html/Articles/Elements/IncludeArticle.rej

cat /opt/rt5/share/html/Articles/Elements/IncludeArticle.rej

— share/html/Articles/Elements/IncludeArticle
+++ share/html/Articles/Elements/IncludeArticle
@@ -78,8 +78,9 @@ if ( $ret && $article->Id ){
return;
}

+ # $Ticket below is used by RT::Extension::ArticleTemplates
my $formatted_article = $m->scomp(’/Articles/Article/Elements/Preformatted’,
- Article => $article
+ Article => $article, Ticket => $Ticket
);

 $m->callback( Article => $article, Ticket => $Ticket, formatted_article => \$formatted_article, ARGSRef => \%ARGS );

Can you explain the process you’re taking in the web UI to test?

I just choose some ticket and go to Action->Reply and Include Article, that loads some template.
I’m using a portuguese version so i don’t know if the button names are correctly.

When you first applied the patch and installed the extension, did you clear the mason cache and restart the web server?

Yes.
And i restarted apache server and the operating system too.

I have make the process all over again on upgrading from 4.4.4 to 5.0.1 with no success.
I have no idea of what’s going on. I think it’s just a simple action to resolve this… but i’m not progressing on this problem because i’m not knowing how to debug this.

Is the extension enabled? You can check on the Admin->Tools->System configuration page and see if it is listed under extensions

1 Like

My Plugins list in System Configuration is empty []. lol
So… i think i found my problem. :confused:
Thanks!