diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.php index dbefb2e7b720..7b1f3c49ba0c 100755 --- a/app/Http/Controllers/AssetModelsController.php +++ b/app/Http/Controllers/AssetModelsController.php @@ -286,6 +286,7 @@ public function getClone($modelId = null) return view('models/edit') ->with('depreciation_list', Helper::depreciationList()) ->with('item', $model) + ->with('model_id', $model_to_clone->id) ->with('clone_model', $model_to_clone); } diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 8d33f94b1593..4bb5cac6c095 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -33,14 +33,9 @@ -@php - $model_id = $item->id; - if (is_null($model_id)){ - $model_id = $item->getOriginal('id'); - } -@endphp -@livewire('custom-field-set-default-values-for-model',["model_id" => $model_id]) + +@livewire('custom-field-set-default-values-for-model',["model_id" => ($item->id) ? $item->id : $model_id]) @include ('partials.forms.edit.notes') @include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])