From d67975cb62f1f5ddb5bc3fa7c5297cb71e3388ea Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 21 Aug 2024 16:59:44 -0700 Subject: [PATCH] Implement fix --- app/Http/Controllers/AssetModelsController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index b6bb34738d..60b1a39803 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -151,17 +151,17 @@ class AssetModelsController extends Controller $model->notes = $request->input('notes'); $model->requestable = $request->input('requestable', '0'); - $this->removeCustomFieldsDefaultValues($model); - $model->fieldset_id = $request->input('fieldset_id'); - if ($this->shouldAddDefaultValues($request->input())) { - if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){ - return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error')); - } - } - if ($model->save()) { + $this->removeCustomFieldsDefaultValues($model); + + if ($this->shouldAddDefaultValues($request->input())) { + if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))) { + return redirect()->back()->withInput()->with('error', trans('admin/custom_fields/message.fieldset_default_value.error')); + } + } + if ($model->wasChanged('eol')) { if ($model->eol > 0) { $newEol = $model->eol;