From 907ec36bd9f8c37c38c34b510b5af4e3ae26fd2a Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Sat, 11 Jun 2016 19:10:01 -0500
Subject: [PATCH] thread: Keep attachments when editing thread entry

---
 include/class.thread_actions.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/class.thread_actions.php b/include/class.thread_actions.php
index 428793399..6650ee098 100644
--- a/include/class.thread_actions.php
+++ b/include/class.thread_actions.php
@@ -164,6 +164,11 @@ JS
             $old = $original;
         }
 
+        // Move the attachments to the new entry
+        $old->attachments->update(array(
+            'object_id' => $entry->id
+        ));
+
         // Mark the new entry as edited (but not hidden nor guarded)
         $entry->flags = ($old->flags & ~(ThreadEntry::FLAG_HIDDEN | ThreadEntry::FLAG_GUARDED))
             | ThreadEntry::FLAG_EDITED;
-- 
GitLab