diff --git a/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php b/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php index 6816edea7f..e1487d2151 100644 --- a/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php +++ b/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php @@ -17,6 +17,10 @@ class CustomFieldSetDefaultValuesForModel extends Component public function mount() { + if(is_null($this->model_id)){ + return; + } + $this->model = AssetModel::find($this->model_id); // It's possible to do some clever route-model binding here, but let's keep it simple, shall we? $this->fieldset_id = $this->model->fieldset_id; diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index ee299cdde4..436e425179 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -34,9 +34,7 @@ -@if (isset($item->id)) - @livewire('custom-field-set-default-values-for-model',["model_id" => $item->id]) -@endif +@livewire('custom-field-set-default-values-for-model',["model_id" => $item->id]) @include ('partials.forms.edit.notes') @include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/models/general.requestable')])