From f9272f0bb2a0fe7c5bd138ffcb75d6da664e9a1b Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 15 May 2017 18:51:58 +0530 Subject: [PATCH] storage-updates --- app/FaveoStorage/Controllers/StorageController.php | 12 +++++++++--- .../Controllers/Client/helpdesk/FormController.php | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/FaveoStorage/Controllers/StorageController.php b/app/FaveoStorage/Controllers/StorageController.php index c3d60cf7e..7cd9d064e 100644 --- a/app/FaveoStorage/Controllers/StorageController.php +++ b/app/FaveoStorage/Controllers/StorageController.php @@ -187,6 +187,7 @@ class StorageController extends Controller { public function saveAttachments($thread_id, $attachments = []) { $disposition = 'ATTACHMENT'; + $thread = ''; foreach ($attachments as $attachment) { if (is_object($attachment)) { if (method_exists($attachment, 'getStructure')) { @@ -215,11 +216,16 @@ class StorageController extends Controller { public function updateBody($attachment, $thread_id, $filename) { $threads = new Ticket_Thread(); $thread = $threads->find($thread_id); - $structure = $attachment->getStructure(); $disposition = 'ATTACHMENT'; - if (isset($structure->disposition)) { - $disposition = $structure->disposition; + if (is_object($attachment)) { + if (method_exists($attachment, 'getStructure')) { + $structure = $attachment->getStructure(); + if (isset($structure->disposition)) { + $disposition = $structure->disposition; + } + } } + if ($disposition == 'INLINE' || $disposition == 'inline') { $id = str_replace('>', '', str_replace('<', '', $structure->id)); $body = $thread->body; diff --git a/app/Http/Controllers/Client/helpdesk/FormController.php b/app/Http/Controllers/Client/helpdesk/FormController.php index 4b48a341d..15afebc94 100644 --- a/app/Http/Controllers/Client/helpdesk/FormController.php +++ b/app/Http/Controllers/Client/helpdesk/FormController.php @@ -248,6 +248,7 @@ class FormController extends Controller return Redirect::back()->withInput($request->except('password'))->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken')); } } catch (\Exception $ex) { + dd($ex); return redirect()->back()->with('fails', $ex->getMessage()); } // dd($result);