From 5dc54e9974a486907d418c903d122471f0adad6b Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 11 Aug 2015 07:46:45 -0500
Subject: [PATCH] sla: Capture current sla before setting new one

---
 include/class.ticket.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index fa4024056..18e13014f 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -2635,6 +2635,9 @@ implements RestrictedAccess, Threadable {
         if ($errors)
             return false;
 
+        // Decide if we need to keep the just selected SLA
+        $keepSLA = ($this->getSLAId() != $vars['slaId']);
+
         $this->topic_id = $vars['topicId'];
         $this->sla_id = $vars['slaId'];
         $this->source = $vars['source'];
@@ -2666,9 +2669,6 @@ implements RestrictedAccess, Threadable {
         if ($vars['note'])
             $this->logNote(_S('Ticket Updated'), $vars['note'], $thisstaff);
 
-        // Decide if we need to keep the just selected SLA
-        $keepSLA = ($this->getSLAId() != $vars['slaId']);
-
         // Update dynamic meta-data
         foreach ($forms as $f) {
             if ($C = $f->getChanges())
-- 
GitLab