[Bps-public-commit] rt-extension-articletemplates branch, compilation-and-runtime-errors, created. 0.05-1-g52830f3

Ruslan Zakirov ruz at bestpractical.com
Mon Feb 6 17:10:41 EST 2012


The branch, compilation-and-runtime-errors has been created
        at  52830f3e7cc54974bf913c62f0ef09623d584984 (commit)

- Log -----------------------------------------------------------------
commit 52830f3e7cc54974bf913c62f0ef09623d584984
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Feb 7 02:09:24 2012 +0400

    when parsing fails don't put code into message box
    
    Push error message through %session

diff --git a/html/Elements/RT-Extension-ArticleTemplates/ProcessContent b/html/Elements/RT-Extension-ArticleTemplates/ProcessContent
index 94d3b99..9f1ffba 100644
--- a/html/Elements/RT-Extension-ArticleTemplates/ProcessContent
+++ b/html/Elements/RT-Extension-ArticleTemplates/ProcessContent
@@ -8,6 +8,9 @@ if (RT->Config->Get('ArticleTemplatesWithRequestArgs')) {
 my ($new, $msg) = $Article->ParseTemplate( $$content, %variables );
 unless ( defined $new && length $new ) {
     $RT::Logger->error("Couldn't parse article's content: $msg");
+    push @{ $session{'Actions'}{''} ||=[] },
+        loc("Couldn't load article. Contact system administrator.");
+    $$content = '';
 } else {
     $$content = $new;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list