Merge pull request #13528 from inietov/fixes/cloning_model_blanks_fieldset

Fixed #12548 Cloning a model blanks fieldset of new one
This commit is contained in:
snipe 2023-08-29 19:14:38 +01:00 committed by GitHub
commit 22d136df46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -286,6 +286,7 @@ class AssetModelsController extends Controller
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);
}

View file

@ -34,7 +34,8 @@
</div>
<!-- Custom Fieldset -->
@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id])
<!-- If $item->id is null we are cloning the model and we need the $model_id variable -->
@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')])