From 610e270db8ee91b31876e47524871fa68358db7f Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 5 Jul 2013 15:05:58 -0400
Subject: [PATCH] Fix bug in EmailTemplate::lookupByName

---
 include/class.template.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class.template.php b/include/class.template.php
index 2dcb5d00e..74f9c76aa 100644
--- a/include/class.template.php
+++ b/include/class.template.php
@@ -445,8 +445,8 @@ class EmailTemplate {
         return self::lookup(self::create($vars, $errors));
     }
 
-    function lookupByName($tpl, $name, $group=null) {
-        $sql = 'SELCT id FROM '.EMAIL_TEMPLATE_TABLE
+    function lookupByName($tpl_id, $name, $group=null) {
+        $sql = 'SELECT id FROM '.EMAIL_TEMPLATE_TABLE
             .' WHERE tpl_id='.db_input($tpl_id)
             .' AND code_name='.db_input($name);
         if (($res=db_query($sql)) && ($id=db_result($res)))
-- 
GitLab