mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Merge pull request #12726 from snipe/fixes/12724_custom_fields
Fixed #12724 - fieldset not saving on model
This commit is contained in:
commit
aa4bdd4eb3
|
@ -82,8 +82,8 @@ class AssetModelsController extends Controller
|
|||
$model->user_id = Auth::id();
|
||||
$model->requestable = Request::has('requestable');
|
||||
|
||||
if ($request->input('custom_fieldset') != '') {
|
||||
$model->fieldset_id = e($request->input('custom_fieldset'));
|
||||
if ($request->input('fieldset_id') != '') {
|
||||
$model->fieldset_id = e($request->input('fieldset_id'));
|
||||
}
|
||||
|
||||
$model = $request->handleImages($model);
|
||||
|
@ -160,10 +160,10 @@ class AssetModelsController extends Controller
|
|||
|
||||
$this->removeCustomFieldsDefaultValues($model);
|
||||
|
||||
if ($request->input('custom_fieldset') == '') {
|
||||
if ($request->input('fieldset_id') == '') {
|
||||
$model->fieldset_id = null;
|
||||
} else {
|
||||
$model->fieldset_id = $request->input('custom_fieldset');
|
||||
$model->fieldset_id = $request->input('fieldset_id');
|
||||
|
||||
if ($this->shouldAddDefaultValues($request->input())) {
|
||||
if (!$this->assignCustomFieldsDefaultValues($model, $request->input('default_values'))){
|
||||
|
@ -444,7 +444,7 @@ class AssetModelsController extends Controller
|
|||
{
|
||||
return ! empty($input['add_default_values'])
|
||||
&& ! empty($input['default_values'])
|
||||
&& ! empty($input['custom_fieldset']);
|
||||
&& ! empty($input['fieldset_id']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue