From 8588be670d519abe3ba2435534c7aece683e4b64 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 31 Jul 2014 16:37:35 -0500
Subject: [PATCH] oops: Allows edits to ticket custom data

---
 scp/tickets.php | 3 ++-
 tickets.php     | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/scp/tickets.php b/scp/tickets.php
index 1dda6f0fd..6342dcaa9 100644
--- a/scp/tickets.php
+++ b/scp/tickets.php
@@ -202,7 +202,8 @@ if($_POST && !$errors):
                 // Don't validate deleted forms
                 if (!in_array($form->getId(), $_POST['forms']))
                     continue;
-                elseif (!$form->isValid())
+                $form->setSource($_POST);
+                if (!$form->isValid())
                     $errors = array_merge($errors, $form->errors());
             }
             if(!$ticket || !$thisstaff->canEditTickets())
diff --git a/tickets.php b/tickets.php
index 0d675aa88..b2655fa13 100644
--- a/tickets.php
+++ b/tickets.php
@@ -47,9 +47,11 @@ if($_POST && is_object($ticket) && $ticket->getId()):
             $errors['err']='Access Denied. Client updates are currently disabled';
         else {
             $forms=DynamicFormEntry::forTicket($ticket->getId());
-            foreach ($forms as $form)
+            foreach ($forms as $form) {
+                $form->setSource($_POST);
                 if (!$form->isValid())
                     $errors = array_merge($errors, $form->errors());
+            }
         }
         if (!$errors) {
             foreach ($forms as $f) $f->save();
-- 
GitLab