From 66686f80803e043bf3614ebb3381cb398f043ba0 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 24 Aug 2020 18:32:15 -0700 Subject: [PATCH] Added some debugging - will remove at RC --- app/Http/Requests/ImageUploadRequest.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Http/Requests/ImageUploadRequest.php b/app/Http/Requests/ImageUploadRequest.php index 9f1d04b8e7..acf51970b5 100644 --- a/app/Http/Requests/ImageUploadRequest.php +++ b/app/Http/Requests/ImageUploadRequest.php @@ -121,13 +121,17 @@ class ImageUploadRequest extends Request } // If the user isn't uploading anything new but wants to delete their old image, do so - } elseif ($this->input('image_delete')=='1') { + } else { + \Log::debug('No image was passed - not sure what to do now.'); + if ($this->input('image_delete')=='1') { - try { - Storage::disk('public')->delete($path.'/'.$item->{$fieldname}); - $item->{$fieldname} = null; - } catch (\Exception $e) { - \Log::debug($e); + + try { + Storage::disk('public')->delete($path . '/' . $item->{$fieldname}); + $item->{$fieldname} = null; + } catch (\Exception $e) { + \Log::debug($e); + } } }